我正在尝试使用 OceanOptics 光谱仪对我的计算机显示器进行伽玛校正以收集数据,并使用 Pyschopy 的伽玛校正模块来线性化曲线。
该程序似乎可以运行大约 4/5 次,但当我尝试设置 GammaRamp 时偶尔会出现错误。我只是错误可能是什么。使用 ctypes 进行 32-64 位转换是否有问题?这是我得到的错误:
Traceback (most recent call last):
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\Lib\site-packages\aibs\chrisgammatest.py", line 139, in <module>
Calib=GammaTest()
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\Lib\site-packages\aibs\chrisgammatest.py", line 22, in __init__
self.monitorcal()
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\Lib\site-packages\aibs\chrisgammatest.py", line 81, in monitorcal
sample=self.gammaTest()
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\Lib\site-packages\aibs\chrisgammatest.py", line 42, in gammaTest
window=visual.Window(units='norm',monitor=monitortype, fullscr = True, screen = screennumber, waitBlanking=True)
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\psychopy\visual.py", line 334, in __init__
self.setGamma(self.gamma)#using either pygame or bits++
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\psychopy\visual.py", line 935, in setGamma
self.winHandle.setGamma(self.winHandle, self.gamma)
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\psychopy\gamma.py", line 34, in setGamma
setGammaRamp(pygletWindow, newLUT)
File "C:\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\psychopy\gamma.py", line 51, in setGammaRamp
success = windll.gdi32.SetDeviceGammaRamp(pygletWindow._dc, newRamp.ctypes)
ctypes.ArgumentError: argument 1: <type 'exceptions.OverflowError'>: long int too long to convert