我已經試過功能math.exp()
,但它給錯誤如何找到一個圖像的反對數對比中蟒蛇
NewImg[j,k]=a*math.exp(img[j,k])
OverflowError:Python int too large to convert to C long
這裏img
是我的輸入圖像。
我已經試過功能math.exp()
,但它給錯誤如何找到一個圖像的反對數對比中蟒蛇
NewImg[j,k]=a*math.exp(img[j,k])
OverflowError:Python int too large to convert to C long
這裏img
是我的輸入圖像。
你的錯誤是:
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]))
忘了上傳你的圖片。在這裏如何做到這一點:https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post – rakwaht
該圖像在這裏是沒用的 – kenfire