1
我有一個圖像,我想按比例應用膨脹,侵蝕,關閉,打開操作的圖像大小。如何在Python中按比例將圖像應用於圖像?
在我的代碼中,我將圖像分爲三組,但我認爲使用其他更好的方法會更好。我如何逐漸改變我的操作的磁盤大小?
import pymorph as pm
import mahtoas as mh
if (shape[0] < 100):
w = (shape[0]/100)*0.2
elif(shape[0]> 100 and shape[0] <220):
w = (shape[0]/100)*1.0
else:
w = (shape[0]/100)*3
#structuring elements
disk7 = pm.sedisk(w)
bfork = mh.morph.dilate(bfork, disk7)