Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect log function in the pupil diameter computation of "Barten (1999)" contrast sensitivity function. #1022

Closed
xmsguan opened this issue Aug 2, 2022 · 1 comment

Comments

@xmsguan
Copy link

xmsguan commented Aug 2, 2022

return as_float(5 - 3 * np.tanh(0.4 * np.log(L * X_0 * Y_0 / 40**2)))

The np.log function should be replaced by np.log10
See Beau's work at JOV that traces the log function back to the work by Crawford (1936)

With np.log10, the Barten (flat) curve in the example should evaluate instead to:
[0.021876435681538915, 0.014184813713158736, 0.00952448986054018, 0.006680496306613172, 0.004924641286022344, 0.0038228778810919495, 0.003118856932347983, 0.002662754642667843, 0.002367458781369199, 0.0021814667512135366]

With np.log10, the Barten (flat) and Barten (ramp) curves, evaluated at X0=60, L = [0.001, 0.01, 0.1, 1.0, 10.0, 100.0] are:

Barten (flat):
[0.06299067646573944, 0.021876435681538915, 0.008678146175280605, 0.004311183591087381, 0.0027590747863252907, 0.0021814667512135366]

Barten (ramp):
[0.12598135293147888, 0.04375287136307783, 0.01735629235056121, 0.008622367182174762, 0.0055181495726505814, 0.004362933502427073]

which fit closer to Figure 33 of ITU BT.2246 and also Figure 4 of the following paper:

S. Miller, M. Nezamabadi, S. Daly, "Perceptual Signal Coding for More Efficient Usage of Bit Codes," SMPTE Meeting Presentation, 2012

@xmsguan xmsguan changed the title Incorrect log function in the pupile diameter function Incorrect log function in the pupil diameter function Aug 2, 2022
@KelSolaar KelSolaar added this to the v0.4.2 milestone Aug 7, 2022
@KelSolaar
Copy link
Member

Thanks a lot @xmsguan!

@nick-shaw and I always wondered why we could not get closer to Miller et al. figure and ITU BT.2246. Admittedly I would not have figured out as it is not specified in Barten's thesis.

Cheers,

Thomas

@KelSolaar KelSolaar changed the title Incorrect log function in the pupil diameter function Incorrect log function in the pupil diameter computation of "Barten (1999)" contrast sensitivity function. Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants