Project

General

Profile

Bug #11683

Pentax K-S2: lens correction auto-scale fails

Added by Rob Oo about 2 years ago. Updated over 1 year ago.

Status:
Incomplete
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
-
Start date:
08/05/2017
Due date:
% Done:

20%

Estimated time:
Affected Version:
2.2.5
System:
Debian
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Hi, I noticed that on my Pentax K-S2 the lens correction auto-scaling fails.
If I manually press the little arrow in the lens correction UI, it scales properly. This happens on all my lenses (Pentax and third party), and it does not happen on any other body than the K-S2.
Is this a bug? What do you need from me to investigate or fix this?

IMGP3368.DNG (21.4 MB) IMGP3368.DNG Rob Oo, 08/05/2017 03:44 PM

History

#1 Updated by Roman Lebedev about 2 years ago

  • % Done changed from 0 to 20
  • Status changed from New to Incomplete

Rob Oo wrote:

Hi, I noticed that on my Pentax K-S2

It would be very nice if you could upload a full sample set for that camera to https://raw.pixls.us/
In this case, only two shots are needed: PEF and DNG, of some static scene, taken with stable camera (tripod?)

the lens correction auto-scaling fails.
If I manually press the little arrow in the lens correction UI, it scales properly. This happens on all my lenses (Pentax and third party), and it does not happen on any other body than the K-S2.
Is this a bug? What do you need from me to investigate or fix this?

Please upload one such image here. Also, which lensfun version?

#2 Updated by Rob Oo about 2 years ago

Hi Roman,
I uploaded the PEF and DNG files to https://raw.pixls.us/.
One is attached here.
Lensfun version is 0.3.2. Using the lensfun-update-data script makes no difference (as expected).

Best, Rob

#3 Updated by Roman Lebedev about 2 years ago

Rob Oo wrote:

Hi Roman,
I uploaded the PEF and DNG files to https://raw.pixls.us/.

Thank you!

One is attached here.
Lensfun version is 0.3.2. Using the lensfun-update-data script makes no difference (as expected).

Best, Rob

Hmm. Just to be sure, you are talking about the fact that default "scale" is 1.0, and it updates to 1.002 after you press "auto scale", and NOT about the fact that image changes significantly after you press "auto scale" which enables the lens correction module?
I.e. if you reset the module, explicitly enable it, and then press "auto scale", the problem still only disappears after "auto scale"?

#4 Updated by Rob Oo about 2 years ago

Hi Roman,

you are talking about the fact that default "scale" is 1.0, and it updates to 1.002 after you press "auto scale",

Yes.

I.e. if you reset the module, explicitly enable it, and then press "auto scale", the problem still only disappears after "auto scale"?

Yes.

The problem is the curvature around the image, because if incorrect scaling. The lens corrections appears to be applied correctly.

Best, Rob

#5 Updated by Roman Lebedev about 2 years ago

Rob Oo wrote:

Hi Roman,

you are talking about the fact that default "scale" is 1.0, and it updates to 1.002 after you press "auto scale",

Yes.

Well, i can confirm that i observe that behaviour too. But i don't know what's wrong.
Maybe Torsten Bronger has some ideas?

I.e. if you reset the module, explicitly enable it, and then press "auto scale", the problem still only disappears after "auto scale"?

Yes.

The problem is the curvature around the image, because if incorrect scaling. The lens corrections appears to be applied correctly.

Best, Rob

#6 Updated by Torsten Bronger about 2 years ago

The auto scale code takes some safety buffer into account in order to compensate for colour channel reduction due to TCA correction. This way, the coloured rims are avoided.

#7 Updated by Roman Lebedev about 2 years ago

Torsten Bronger wrote:

The auto scale code takes some safety buffer into account in order to compensate for colour channel reduction due to TCA correction. This way, the coloured rims are avoided.

But surely the computation of the auto-scale is deterministic?
What we are seeing here, is that lensfun for some reason produces two different auto-scales - by 'default' - and after user manually pressed "calculate auto-scale"

#8 Updated by Torsten Bronger about 2 years ago

Lensfun's auto scale code (i.e. the API function exposed to DT) is not called for this DNG until you request for it explicitly in DT. I have no clue why. With my own images, the function is called when I open the image.

#9 Updated by Rob Oo over 1 year ago

Hi guys, any news on this? It is slowly driving me nuts.
Is there anything I can do to help you diagnose the issue? Many thanks, Rob

#10 Updated by Tobias Ellinghaus over 1 year ago

After digging into this a little I found out that when loading the file darktable looks for a lens profile for maker "RICOH IMAGING COMPANY, LTD." and camera "PENTAX K-S2". That is consistent to what exiv2 gives as "Exif.Image.Make". However, Lensfun doesn't know that camera with that name. Later on darktable somehow sanitizes the camera maker to "Pentax" which then works. So subsequent clicks on the auto scale button show the correct value.

#11 Updated by Rob Oo over 1 year ago

Thanks a lot for that Tobias!. That provides a quick and easy workaround.
Manually adding a section to /var/lib/lensfun-updates/version_1/slr-pentax.xml:
<camera>
<maker>RICOH IMAGING COMPANY, LTD.</maker>
<model>Pentax K-S2</model>
<model lang="en">K-S2</model>
<mount>Pentax KAF2</mount>
<cropfactor>1.534</cropfactor>
</camera>
solves the issue for now.

Also available in: Atom PDF

Go to top