我已经尝试了函数math.exp()
,但是它给出了错误
NewImg[j,k]=a*math.exp(img[j,k])
OverflowError:Python int too large to convert to C long
此处img
是我的输入图片。
答案 0 :(得分:0)
您的错误是:
OverflowError:Python int too large to convert to C long
你应该看看这些问题:
在上一个问题中,建议使用decimal
module因为exp()
函数返回的小数位数很多。
from decimal import Decimal
NewImg[j,k]= Decimal(a*math.exp(img[j,k]))