Commit Graph

2607 Commits

Author SHA1 Message Date
Lawrence
b2a5c6a0f3 Fix a homogeneous function parameter type
The rotation matrix function signature used a generic type for the
rotation angle. Change it to double.
2020-01-18 10:59:57 -08:00
Lawrence
d9886d58f9 Take auto perspective correction files from ART 2020-01-13 19:51:38 -08: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
253da17bc7 Add homogeneous scale transformation
Add function to generate homogeneous 3 dimensional scale transformation
matrices.
2019-12-25 14:45:47 -08:00
Lawrence
1c6a635497 Add homogeneous coordinate functions
Add functions for transformations in 3 dimensional homogeneous space.
These include functions that generate transformation matrices and
perform matrix multiplication.
2019-12-24 15:18:15 -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
Ingo Weyrich
3a207dace7 Some optimizations for capture sharpening 2019-12-18 17:33:41 +01:00
Ingo Weyrich
5e0ad767ad Capture sharpening: fix wrong calculation for radius > 0.84 2019-12-18 13:16:37 +01:00
Ingo Weyrich
6b22101500 better white level for FUJIFILM X-A7 2019-12-15 17:00:50 +01:00
Ingo Weyrich
eb4fe6a7c6 Merge pull request #5562 from Beep6581/review_demosaicers
Clip negative values to zero in raw processing, #5561
2019-12-13 16:54:51 +01:00
Ingo Weyrich
0c10b1466e raw crop for Leica SL2 2019-12-13 14:39:05 +01:00
Ingo Weyrich
92c29bcd65 Skip capture sharpening for predemosaiced raw files, fixes #5563 2019-12-13 13:50:00 +01:00
Ingo Weyrich
4d72fc0b5b Do not generate negative values if raw values are less than black level, #5562 2019-12-12 20:05:43 +01:00
Ingo Weyrich
637e8454ef Do not generate negative values in output of raw ca-correction, #5562 2019-12-12 19:59:27 +01:00
Ingo Weyrich
b2218d05dd clip negative output of demosaicers to zero, #5561 2019-12-12 18:45:18 +01:00
Ingo Weyrich
a2dd906115 flush denormals to zeros for mask blur, #5560 2019-12-11 13:00:09 +01:00
Ingo Weyrich
1d08c9355d Capture sharpening: speedup processing of flat areas 2019-12-09 15:34:04 +01:00
Floessie
ba36a92240 Merge pull request #5534 from Beep6581/cr3_cleanup
CR3 decoder cleanup and fixes
2019-12-07 11:57:36 +01:00
Flössie
b1bce98c06 supportsPartial is bool 2019-12-07 09:38:18 +01:00
Ingo Weyrich
743827c7c8 Fix cppcheck warnings 2019-12-06 12:21:19 +01:00
Flössie
b0e52b3202 Whitespace corrections 2019-12-06 09:28:34 +01:00
Flössie
03c094a42b Fix fseek()/ftell() issue 2019-12-06 09:18:16 +01:00
Flössie
8f82a8362a Finalize const/bool cleanup 2019-12-06 08:18:17 +01:00
Ingo Weyrich
10b085b01e lmmse demosaic: own compilation unit and some cleanups 2019-12-05 21:40:32 +01:00
Ingo Weyrich
170a3a18c5 white level for Fujifilm HS30EXR 2019-12-05 17:15:06 +01:00
Ingo Weyrich
7fd54cb56f white level for Fujifilm X10 2019-12-05 16:40:44 +01:00
Flössie
2ceda11912 Fix Apple build (fixes #5553) 2019-12-05 09:54:16 +01:00
Flössie
49f5833002 More bool and const (WIP) 2019-12-04 10:25:52 +01:00
Ingo Weyrich
a2b0167339 Fix broken non OMP build 2019-12-02 19:46:00 +01:00
Ingo Weyrich
f95acfe74e Multithread lensfun vignetting correction 2019-12-02 17:32:13 +01:00
Flössie
5852ee02b9 Make LFDatabase::findModifier() non-static 2019-12-02 08:20:25 +01:00
Ingo Weyrich
92e6768bee Improve caching of lensfun mismatches 2019-11-29 15:19:34 +01:00
Flössie
c4fe355fbb Fix formatting and use bool (WIP) 2019-11-29 14:57:14 +01:00
Ingo Weyrich
b8dcd93a6a Reduce searches for lensfun data if there is no entry for the combo of camera and lens 2019-11-29 13:09:37 +01:00
Ingo Weyrich
200d746465 Capture sharpening: fix border issues 2019-11-28 16:07:41 +01:00
Flössie
c5168038e8 Add missing include 2019-11-28 10:37:18 +01:00
Flössie
4529999f49 C++-style casts (clang-tidy) 2019-11-28 09:11:56 +01:00
Flössie
85abe54a16 Replace defines 2019-11-28 08:54:38 +01:00
Flössie
63fa62e0e2 Merge branch 'dev' into cr3_cleanup 2019-11-28 07:39:00 +01:00
Ingo Weyrich
04b08741ee Further cleanups 2019-11-27 18:55:20 +01:00
Flössie
97960f335f Fix silly error and with it the Clang build 2019-11-27 10:32:43 +01:00
Flössie
4f153a6d72 Fix warnings 2019-11-27 09:49:13 +01:00
Ingo Weyrich
79431ffa1d Some changes suggested by @Floessie 2019-11-26 19:42:48 +01:00
Ingo Weyrich
2a4891827d Some cleanups 2019-11-26 15:25:11 +01:00
Flössie
e89b6be76e DCraw::parseCR3() cleanup 2019-11-26 09:52:51 +01:00
Ingo Weyrich
f054ed00e8 Pixelshift: optionally use RCD+VNG4 for motion parts 2019-11-25 01:00:49 +01:00
Ingo Weyrich
614458c3c6 added support for Sony A7rIV 16-shot pixel-shift files, ported from ART, thanks to @agriggio 2019-11-22 17:26:44 +01:00
Ingo Weyrich
81f9ab7315 Regression in Olympus E-M10MarkII raw black levels, fixes #5535 2019-11-22 14:37:10 +01:00
Flössie
2ae5f198d7 Cleanups for the first few lines 2019-11-22 10:40:01 +01:00