ia870 - Python Morphology Toolbox

A collection of Morphological Image Processing tools written in Python and the Numpy package. It provides tools to reproduce most examples of the book: Dougherty and Lotufo, Hands-on Morphological Image Processing, SPIE, 2003, ISSN=0-8194-4720-X.

This toolbox has been developed in the Adessowiki environment. To know more about Adessowiki, please access the MainPage and the history of the project: History.


  • iadarea - Remove objects with small areas in binary images.
  • iadlabeltext - Segmenting letters, words and paragraphs.
  • iadbeef - Detect the lean meat region in a beef steak image.
  • iadblob - Demonstrate blob measurements and display.
  • iadbrain - Extract the lateral ventricle from an MRI image of the brain.
  • iadcalc - Extract the keys of a calculator.
  • iadcells - Extract blood cells and separate them.
  • iadchickparts - Classify chicken parts in breast, legs+tights and wings.
  • iadconcrete - Aggregate and anhydrous phase extraction from a concrete section observed by a SEM image.
  • iadcookies - Detect broken rounded biscuits.
  • iadcornea - Cornea cells marking.
  • iadfabric - Detection of vertical weave in fabrics.
  • iadfila - Detect Filarial Worms.
  • iadflatzone - Flat-zone image simplification by connected filtering.
  • iadflow - Detect water in a static image of an oil-water flow experiment.
  • iadgear - Detect the teeth of a gear
  • iadholecenter - Hole center misalignment in PCB.
  • iadlith - Detect defects in a microelectronic circuit.
  • iadpcb - Decompose a printed circuit board in its main parts.
  • iadpieces - Classify two dimensional pieces.
  • iadpotatoes - Grade potato quality by shape and skin spots.
  • iadrobotop - Detect marks on a robot.
  • iadruler - Detect defects in a ruler.
  • iadsoil - Detect fractures in soil.

Image Creation

  • iaframe - Create a frame image.
  • iadrawv - Superpose points, rectangles and lines on an image.
  • iatext - Create a binary image of a text.

Thinning And Thickening

  • iacthick - Image transformation by conditional thickening.
  • iacthin - Image transformation by conditional thinning.
  • iathick - Image transformation by thickening.
  • iathin - Image transformation by thinning.

Image Information, Manipulation and Auxiliary functions

  • iaadd4dil - Addition for dilation
  • iaconcat - Concatenate two or more images along width, height or depth.
  • ialimits - Get the possible minimum and maximum of an image.
  • iamaxleveltype - Returns the maximum value associated to an image datatype
  • iamat2set - Converts image representation from matrix to set
  • iaNlut - Pre-computes the raster offsets of neighbors of all pixels
  • iapad - Extend the image inserting a frame around it.
  • iapad4n - iapad4n
  • iase2off - Structuring element to neighbor offsets
  • iaset2mat - Converts image representation from set to matrix
  • iaunpad - Undo the iapad function, i.e., removes a frame around the image, reducing its size.


  • iablob - Blob measurements from a labeled image.
  • iagrain - Gray-scale statistics for each labeled region.
  • ialabel - Label a binary image.
  • ialabelflat - Label the flat zones of gray-scale images.
  • iapatspec - Pattern spectrum (also known as granulometric size density).
  • iastats - Find global image statistics.


Image Transforms

Watershed Transforms

  • iawatershed - Watershed Transform by Connected Components.
  • iacwatershed - Watershed by Markers.
  • iatz - Tie-Zone Transform of Watershed.
  • ipdp - Utilities to facilitate the coding of watershed algorithms.

Intervals (hit-or-miss templates)

Structuring Elements

  • iaimg2se - Create a structuring element from a pair of images.
  • iasebox - Create a box structuring element.
  • iasecross - Diamond structuring element and elementary 3x3 cross.
  • iasecrop - Extract the minimum centered odd size dimension rectangle
  • iasedisk - Create a disk or a semi-sphere structuring element.
  • iaseline - Create a line structuring element.
  • iaserot - Rotate a structuring element.
  • iaseshow - Display a structuring element as an image.
  • iasesum - N-1 iterative Minkowski additions
  • iasetrans - Translate a structuring element
  • iasereflect - Reflect a structuring element
  • iasedil - Dilate one structuring element by another
  • iaseunion - Union of structuring elements
  • iaseintersec - Intersection of structuring elements


  • iaglblshow - Apply a random color table to a gray-scale image.
  • iagdtshow - Apply an iso-line color table to a gray-scale image.
  • iagshow - Apply binary overlays as color layers on a binary or gray-scale image
  • iadtshow - Display a distance transform image with an iso-line color table.
  • iabshow - Generate a graphical representation of overlaid binary images.
  • iagsurf - Returns an image with 3D view appearance

Morphological Filters

Data Type Conversion

  • iabinary - Convert a gray-scale image into a binary image
  • iagray - Convert a binary image into a gray-scale image.


  • ianeg - Negate an image.
  • iatoggle - Image contrast enhancement or classification by the toggle operator.
  • iaaddm - Addition of two images, with saturation.
  • iaintersec - Intersection of images.
  • iasubm - Subtraction of two images, with saturation.
  • iasymdif - Symmetric difference between two images
  • iaunion - Union of images.

Connected Operators

Sup-generating And Inf-generating

Dilations And Erosions

  • iacdil - Dilate an image conditionally.
  • iacero - Erode an image conditionally.
  • iadil - Dilate an image by a structuring element.
  • iaero - Erode an image by a structuring element.


  • iacmp - Compare two images pixelwisely.
  • iais - Verify if a relationship among images is true or false.
  • iaisbinary - Check for binary image
  • iaisequal - Verify if two images are equal
  • iaislesseq - Verify if one image is less or equal another (is beneath)
Recently modified pages