Reverse Engineering Nikon Z series lens correction - Part 2?

Just returned from a US East Coast cruise, where I found time to code a rudimentary camera-informed lens correction capability in rawproc. It’s in the master branch on Github (yeah, wish I’d have done a separate branch), it presently only does Nikon Z series (oh, only distortion, need to code up vignetting), and I’m also going to make a few changes to configure its use optionally.

Currently uses exiftool (versions >= 12.72) to extract the parameters, which significantly adds to the time required to load the raw file. One important task to instigate is and exiv2 issue to incorporate the Nikon tags; I don’t plan to retain the exiftool method for long.

The capability is a mode in the lensfun-based lenscorrection tool; you can toggle between the two to compare corrections. Right now for Nikon it’s using the Adobe WarpRetilinear algorithm, which seems to work for most images vice the corresponding lensfun correction, but there are some images that have rendered quite different corrections. Need to open some of the grid-images to compare…

An interesting thing I found is that correction data appears for my AF-P 70-300mm lens, a F-mount lens I use with the FTZ adapter. Makes me think that Nikon has included a table of legacy lenses in their camera firmware, but are getting Z lens data from the lens as they don’t update firmware for new Z lenses.

Anyway, a bit-dodgy implementation, but more is revealed…

1 Like