Commit Graph

119 Commits

Author SHA1 Message Date
Alexander Brock
c491a405a4 Add function needsScale() to make sure scale is applied if defish is not active 2024-07-27 15:30:24 +02:00
Alexander Brock
fc78a64066 Move scale option from perspective correction to lens/geometry 2024-07-20 14:56:21 +02:00
Alexander Brock
6d96bfe5cc Merge branch 'dev' of https://github.com/Beep6581/RawTherapee into defish 2024-07-20 00:15:43 +02:00
Simone Gotti
2b97de233f Add initial metadata lens correction handling 2024-07-08 10:30:51 +02:00
Simone Gotti
b98fa42857 lens profile: report availability of distortion and vignetting
Beside CA, report also distortion and vignetting availability. Rename
is${CORRECTION}Available methods to has${CORRECTION}.
2024-07-08 10:29:43 +02:00
Simone Gotti
dc0e23c82c iptransform: apply distortion and CA correction in a single pass
Some lens profile methods provides a way to correct distortion and CA in
a single step.

When available, applying distortion and CA correction when both enabled
in a single pass is more precise (see lensfun
ApplySubpixelGeometryDistortion doc) since it's usually how the profile
is done. Instead applying the CA correction in a step after distortion
correction could lead to a bit different (also if not always visible)
correction.

This is also required for future lens correction methods (like DNG
WarpRectilinear or corrections based on vendor metadata) that provides
only merged distortion and CA correction in a single pass.
2024-07-08 09:40:36 +02:00
Simone Gotti
55fd4b975e iptransform: move profile based CA with and after distortion
Doing profile based CA as the really first correction in a separate steps is
probably not useful.

Additionally many lens profile (lensfun) and future one provide
functions to do them in a single step with better precision while other
just provide a single step that does both (i.e. DNG WarpRectilinear).

For the above reasons this patch removes the additional pass for CA correction.
This will also improve the perfomance due to less work.
2024-07-08 09:39:23 +02:00
Simone Gotti
363f3cc2a6 iptransform: correct profile based distortion/CA before rotation
Like perspective correction also rotation correction should be applied
after distortion/CA correction.
2024-07-08 09:32:35 +02:00
Alexander Brock
f9e2e934df Move de-fish to distortion 2023-03-22 00:19:26 +01:00
Alexander Brock
e38a36ed9d Make ImProcFunctions::needsTransform more readable 2023-03-04 00:04:23 +01:00
Alexander Brock
8b51d8297f Move de-fishing code _before_ distortion correction, so de-fishing occurs _after_ distortion correction. 2023-02-25 21:59:25 +01:00
Alexander Brock
c29194d2f2 Get rid of magic number in favor of already present computation of the focal length 2023-02-25 21:42:07 +01:00
Alexander Brock
6ed53affda Avoid unnecessary copy of variable 2023-02-22 13:52:06 +01:00
Alexander Brock
20f3b33c5f Add crop factor to fisheye computation 2023-02-22 11:06:49 +01:00
Alexander Brock
2e66dc11a2 Style changes as requested 2023-02-22 10:52:42 +01:00
Alexander Brock
0cfbf86129 Set scale for defishing after determining it manually from blender rendered scene 2023-02-19 20:10:44 +01:00
Alexander Brock
f023a90170 Add camera_defish to PerspCorrection::read/write 2023-02-11 23:51:32 +01:00
Alexander Brock
841e2ff26f Add de-fishing to ImProcFunctions::transCoord so the source window is correctly estimated when using de-fishing 2023-02-11 22:53:23 +01:00
Alexander Brock
fb90908cbd Add GUI elements for defish and scale in perspective tool. Doesn't work very good yet. 2023-02-11 20:31:08 +01:00
Alexander Brock
9de5cb9915 Add hard-coded fisheye un-distortion operation for testing / discussion 2023-02-04 00:59:04 +01:00
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