[hofig3s29] [Up] [hofig3s31] Chapter 3 - Morphological Processing of Binary Images

hofig3s30
Reconstruction from the quench function

Description

This figure illustrates the reconstruction from the quench function.

Demo Script

.

from morph import *
S=mmbinary([
  [0,0,0,0,0,0,0,0,0],
  [0,0,0,0,1,0,0,0,0],
  [0,0,0,1,1,1,0,0,0],
  [0,0,0,1,1,1,0,0,0],
  [0,0,1,1,1,1,1,0,0],
  [0,1,1,1,1,1,1,1,0],
  [0,1,1,1,1,1,1,1,0],
  [0,1,1,1,1,1,1,1,0],
  [0,1,1,1,1,1,1,1,0],
  [0,1,1,1,1,1,1,1,0],
  [0,0,0,0,0,0,0,0,0]])
q=mmskelm(S,mmsebox(),'value')
S0=mmskelmrec(mmgray(mmthreshad(q,1,1),'uint8',1),mmsebox())
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
S1=mmskelmrec(mmgray(mmthreshad(q,2,2),'uint8',2),mmsebox())
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
S2=mmskelmrec(mmgray(mmthreshad(q,3,3),'uint8',3),mmsebox())
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
Sr=mmunion(S0,S1,S2)
fig_a=mmbshow(q,S)
Warning: Converting input image from uint16 to binary uint8.
fig_b=mmbshow(S,S0)
fig_c=mmbshow(S,S1)
fig_d=mmbshow(S,S2)
fig_e=mmbshow(S,Sr)
mmshow(fig_a)
mmshow(fig_b)
mmshow(fig_c)
mmshow(fig_d)
mmshow(fig_e)
fig_a fig_b fig_c fig_d
fig_e

[hofig3s29] [Up] [hofig3s31] http://www.python.org