Skip to content

Commit cce43c6

Browse files
committed
Simplify max calculation
1 parent 94d2f39 commit cce43c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/image_lens_correction.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ defmodule Image.LensCorrection do
177177
# Get the radial distance from the centre
178178
# which is band 0 of the polar image
179179
r = Complex.polar!(index)[0]
180-
r = r / max!(r)
180+
max = Image.get_pixel!(r, 0, 0)
181+
r = r / max
181182

182183
# Correction function from https://lensfun.github.io/calibration-tutorial/lens-vignetting.html
183184
# Also http://download.macromedia.com/pub/labs/lensprofile_creator/lensprofile_creator_cameramodel.pdf

0 commit comments

Comments
 (0)