Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. print(type(superpixels)) # <type 'numpy.ndarray'>
  2. print(superpixels.shape) # (1080, 1920)
  3. print(type(accepted)) # <type 'list'>
  4. print(len(accepted)) # 30676
  5.  
  6. mask = numpy.zeros(image.shape[:2], dtype = "uint8")
  7. mask[numpy.in1d(superpixels, accepted).reshape(mask.shape)] = 255
  8.  
  9. print(type(mask)) # <type 'numpy.ndarray'>
  10. print(mask.shape) # (1080, 1920)
  11.  
  12. mask = (255*(numpy.any(superpixels[...,None] == numpy.asarray(accepted)[None,None,:], axis=2).astype(numpy.uint8))) # ValueError: 'axis' entry is out of bounds
  13.  
  14. print(type(mask))
  15. print(mask.shape)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement