×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Pablo Vasquez
Added: Oct 3, 2016 5:43 PM
Views: 8
Tags: no tags
Snippet used to overcome "label image must be of integral type." erro
  1.  msk = np.zeros(shape=ima.shape)
  2.     msk1 = np.zeros(shape=ima.shape, dtype=np.intp)
  3.     for i in range(2):
  4.         cmask = mask[i, :, :]
  5.         msk = msk + cmask
  6.     msk = msk == 1
  7.     msk1[msk] = 1