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.
This commit is contained in:
Lawrence
2019-12-27 16:40:41 -08:00
parent 253da17bc7
commit f9a8875bb5
13 changed files with 502 additions and 132 deletions

View File

@@ -727,6 +727,12 @@ HISTORY_MSG_491;White Balance
HISTORY_MSG_492;RGB Curves
HISTORY_MSG_493;L*a*b* Adjustments
HISTORY_MSG_494;Capture Sharpening
HISTORY_MSG_496;Perspective - Camera
HISTORY_MSG_497;Perspective - Camera
HISTORY_MSG_498;Perspective - Recovery
HISTORY_MSG_499;Perspective - PCA - Rotation
HISTORY_MSG_500;Perspective - PCA - Scale
HISTORY_MSG_501;Perspective - PCA - Shift
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction
@@ -1803,11 +1809,19 @@ TP_PCVIGNETTE_ROUNDNESS_TOOLTIP;Roundness:\n0 = rectangle,\n50 = fitted ellipse,
TP_PCVIGNETTE_STRENGTH;Strength
TP_PCVIGNETTE_STRENGTH_TOOLTIP;Filter strength in stops (reached in corners).
TP_PDSHARPENING_LABEL;Capture Sharpening
TP_PERSPECTIVE_FOV;Field of view
TP_PERSPECTIVE_CAMERA_CROP_FACTOR;Crop factor
TP_PERSPECTIVE_CAMERA_FOCAL_LENGTH;Focal length
TP_PERSPECTIVE_CAMERA_SHIFT_HORIZONTAL;Horizontal shift
TP_PERSPECTIVE_CAMERA_SHIFT_VERTICAL;Vertical shift
TP_PERSPECTIVE_HORIZONTAL;Horizontal
TP_PERSPECTIVE_LABEL;Perspective
TP_PERSPECTIVE_PROJECTION_PITCH;Vertical
TP_PERSPECTIVE_PROJECTION_ROTATE;Rotation
TP_PERSPECTIVE_PROJECTION_SCALE;Scale
TP_PERSPECTIVE_PROJECTION_SHIFT_HORIZONTAL;Horizontal shift
TP_PERSPECTIVE_PROJECTION_SHIFT_VERTICAL;Vertical shift
TP_PERSPECTIVE_PROJECTION_YAW;Horizontal
TP_PERSPECTIVE_VERTICAL;Vertical
TP_PERSPECTIVE_VERTICAL_BIAS;Vertical bias
TP_PFCURVE_CURVEEDITOR_CH;Hue
TP_PFCURVE_CURVEEDITOR_CH_TOOLTIP;Controls defringe strength by color.\nHigher = more,\nLower = less.
TP_PREPROCESS_DEADPIXFILT;Dead pixel filter