Sigma 2.8 17-50 - wrong distortion correction

I have changed the logic for finding the right distortion coefficients in the LCP files. basically we should look for two things:

  1. no regressions. if you are using LCP for your lenses and you are happy with the results, please check that it is still the case with this patch

  2. better results for problematic lenses. if you have a lens with an LCP that is supposed to work (e.g. coming from Adobe) but RT does a poor job with it, please check if the situation improves with this patch.

in both cases, if possible test with as many apertures, focal lengths and focus distances as possible.

@Morgan_Hardwood how does this sound?

@agriggio it’s good. I’ll put it up as soon as we have a build.

@Morgan_Hardwood great. In the meantime, I put the patch into a proper branch lcp-distortion-alt-match on github

1 Like

I’ve testet the lcp-distortion-alt-match branch and it works great. For some of my lenses I get a better result. Great job. :thumbsup:

I agree that lensfun solution would be better, still about lcp handling in this github issue there is a link to a previously “bad” lcp and an image that showed problems, together with the exported jpeg with a previous rt version: Lens distorsion correction · Issue #2944 · Beep6581/RawTherapee · GitHub

Unfortunatly i’m still using ubuntu 14.04 so i can’t compile from latest, but maybe it could be interesting to try.

Keep up the great work!

I don’t know how the pic is supposed to look, but here are the results with the above branch:

no distortion correction

distortion correction with the given LCP file

how does it look?

1 Like

@TooWaBoo thanks for testing! Two questions:

  • can you tell us which cameras/lenses you tested with?
  • any chance you could provide a windows build so that other people can test? :slight_smile:

Looks great, seems really nicely corrected. Before your patch, corners were really fuzzy!

Thank you!

A compiled test version for Windows (x64. Gtk3.22-15) can be downloaded from here:

No installer included. Extract the folder “RawTherapee_lcp” to e.g. your Desktop and run “rawtherapee.exe” inside this folder.
Cache and settings are saved into “localappdata\RawTherapee-lcp”. It leaves your existing installation untouched.

@agriggio
I’ve tested:

Nikon D90
Nikon AF-S 18-55 VRII, Nikon AF-S 18-105 VR, Tokina 12-24, Samyang 8mm Fish-Eye

Nikon COOLPIX P330

1 Like

Pulled down and tested _lcp build. Works, but over-corrects distortion on my test. Pentax Scenario is here:
https://discuss.pixls.us/t/lcp-file-distortion-correction-backwards/4241

I’m thinking the over-correction could be in the adobe LCP file, but don’t have lightroom to test it further.

Hi @dvan, thanks for testing! I also don’t have lightroom, but I’ll try to import the LCP in lensfun and see whether it behaves differently from RT.

update: I’ve tweaked the matching​ logic a bit more, essentially copying what lensfun is doing when converting LCP profiles. although unfortunately the pic of @dvan is still not properly corrected (now it undercorrects inserted of overcorrecting), the new logic makes more sense than my previous attempt :slight_smile: and it seems to be equally good for the other problematic pictures that have been posted here.
so, I’d like to ask all interested people to test this new version. if there are no regressions, I’d like to merge this asap so that it is included in 5.2 and I can move on to integrating lensfun

@agriggio
I’ve tested your latest mod and I’m not happy with it. It overcorrects my images.

@TooWaBoo thanks for the quick turnaround. I will revert to the previous method then! if no more issues arise, I’ll try to merge in a couple of weeks (just to see whether something else pops up in the meantime)

Google+! Are people still active on that platform?

Yup! RawTherapee has almost 2500 followers.

@agriggio I posted asking for help here: https://plus.google.com/+rawtherapee/posts/5A8aFNZmvdC

@TooWaBoo or anyone, if you could make a new build using Alberto’s new code, I will link it in the G+ post.

Latest compiled test version for Windows (x64. Gtk3.22-15) can be downloaded from here:
https://filebin.net/rab61ck13g6c8x7g

No installer included. Extract the folder “RawTherapee_lcp2” to e.g. your Desktop and run “rawtherapee.exe” inside this folder.
Cache and settings are saved into “localappdata\RawTherapee-lpc”. It leaves your existing installation untouched.

given that @TooWaBoo reported regressions with the latest changes, I reverted them yesterday. so the current code is the first version of my “fix”. I still hope it works better than dev though

It does :slight_smile: