Project

General

Profile

Actions

Morph-M Python - Structuring Element » History » Revision 1

Revision 1/2 | Next »
Serge Koudoro, 10/23/2009 05:05 PM


Morph-M Python - Structuring Element

Structuring elements are the most elementary objects that make it possible to parametrize Morphological operations. Some structuring elements have been predefined, that you can manipulate through their interfaces.

And to create your own, you can use usefull factories.

Neighborhood construction

Hereafter, a little example to construct rectangle structuring element (centered):

def constructRectangeNeighborhood(xSize,ySize):
list=[];
for i in range(xSize):
for j in range(ySize):
list.append(i-xSize/2)
list.append(j-ySize/2)
return NeighborListFactory(ConnexityType.Square, 2,list)
sq9x15 = constructRectangeNeighborhood(9,15)
ImErode(imIn,sq9x15,imOut)
This sample code could be easily extended to other shapes/dimensions.

Updated by Serge Koudoro about 15 years ago · 1 revisions