[mmdflatzone] [Up] [mmdgear] Demonstrations

mmdflow
Detect water in a static image of an oil-water flow experiment.

Description

A gray-scale image of an oil-water flow experiment is processed. This image is composed of a top-lateral view of a transparent pipe containing water, in the center, and oil, around the water. This procedure detects the region where the water is by using connected filtering, thresholding and shape smoothing.

Demo Script

Reading

The gray-scale image of the water-oil flow experiment is read.

>>> a = mmreadgray('flow.tif')

                  
>>> mmshow(a)

                
a

Dark region enhancement

The dark region of the image is enhanced by the close top-hat operator.

>>> b=mmcloseth(a,mmseline(50,90))

                  
>>> mmshow(b)

                
b

Filtering

A connected filtering is applied to remove small artifacts present in the image.

>>> c=mmcloserec(b,mmsebox(5))

                  
>>> mmshow(c)

                
c

Shape filtering

An alternated sequential filtering is used for shape smoothing.

>>> d=mmasf(c,'co',mmsecross())

                  
>>> mmshow(d)

                
d

Thresholding

The original and thresholded image overlayed on the original are presented successively.

>>> e=mmthreshad(d,100)
Warning: Converting input image from int32 to uint8.
>>> mmshow(a)

                  
>>> mmshow(a,e)

                
a a,e

[mmdflatzone] [Up] [mmdgear] Python