SMIL 1.1.1
Loading...
Searching...
No Matches
custom_morpho_operator.py
1from smilPython import *
2
3class myMeanMorphoFunction(MorphImageFunctionBase_UINT8):
4 def processPixel(self, i, relOffList):
5 pixSum = 0.
6 for nb in relOffList:
7 pixSum += self.imageIn[i + nb]
8 self.imageOut[i] = int(pixSum / len(relOffList))
9
10
11imIn = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
12imOut = Image(imIn)
13
14func = myMeanMorphoFunction()
15func(imIn, imOut)
16
17imOut.show()
18