fix(dewarp): change manual slider to percentage (0-200%) instead of raw multiplier
The old -3.0 to +3.0 scale multiplied the full displacement map (up to ~79px) directly, causing extreme distortion at values >1. New slider: - 0% = no correction - 100% = auto-detected correction (default) - 200% = double correction - Step size: 5% Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -668,13 +668,13 @@ def dewarp_image_manual(img: np.ndarray, displacement_map: np.ndarray,
|
||||
Args:
|
||||
img: BGR image (deskewed, before dewarp).
|
||||
displacement_map: The displacement map from auto-dewarp.
|
||||
scale: Manual scale factor (-3.0 to +3.0).
|
||||
scale: Fraction of auto-detected correction (0.0 = none, 1.0 = auto, 2.0 = double).
|
||||
|
||||
Returns:
|
||||
Corrected image.
|
||||
"""
|
||||
scale = max(-3.0, min(3.0, scale))
|
||||
if abs(scale) < 0.01:
|
||||
scale = max(0.0, min(2.0, scale))
|
||||
if scale < 0.01:
|
||||
return img
|
||||
return _apply_displacement_map(img, displacement_map, scale=scale)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user