Skip to content

Implementation of the Urbach-Wilkinson algorithm for grayscale morphological operations with arbitrary flat structuring elements.

License

Notifications You must be signed in to change notification settings

ReneBrals/uw-morpho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Urbach-Wilkinson Algorithm

Implementation of the Urbach-Wilkinson1 algorithm for grayscale morphological operations with arbitrary flat structuring elements. Supports 2D images in JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC, PNM, PPM and PGM file formats through stb and 3D images in P3M. 2D transformations can be used within MATLAB.

Makes use of vector intrinsics and OpenMP to increase performance.

Build Instructions

Standalone program

make

make fast if CPU supports AVX2 (Haswell or newer) for slightly better performance.

make slow if CPU does not support SSE2.

By default, the program will transform lines in stride to achieve parallelism. To split the image in blocks instead, compile with make split, make splitfast or make splitslow.

MATLAB MEX file

Execute the build_uw_morpho.m script within MATLAB.

Usage

Standalone program

2D operations: ./uw2d (erode|dilate|open|close) image_file SE_file

Supports 2D images in JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC, PNM, PPM and PGM file formats.

3D operations: ./uw3d (erode|dilate|open|close) image.p3m SE.p3m

An additional program to generate image files to use as structuring element is provided:

./se_gen (disk|rectangle|h|checkerboard|noise) diameter

MATLAB

erode(f,SE), dilate(f,SE), open(f,SE) and close(f,SE).

Supports uint8 only

Understanding the source code

main.c Main program, handles I/O.

transform.c Morphological transformations.

LUT.C Computation of lookup table.

chordSet.c Decomposition of structuring element into set of chords.

ImagePGM.c Image file I/O.

1. Erik R. Urbach, Michael H. F. Wilkinson, "Efficient 2-D Grayscale Morphological Transformations With Arbitrary Flat Structuring Elements", Image Processing IEEE Transactions on, vol. 17, pp. 1-8, 2008, ISSN 1057-7149. IEEE. https://doi.org/10.1109/TIP.2007.912582

About

Implementation of the Urbach-Wilkinson algorithm for grayscale morphological operations with arbitrary flat structuring elements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages