skimage.morphology от наводнения не работает на большом изображении - PullRequest
0 голосов
/ 30 марта 2020

Я пытаюсь создать маску потока с помощью skimage.morphology.flood, которая охватывает все точки, связанные с данной начальной точкой в ​​массиве numpy. Это работает, когда я создаю небольшое окно вокруг моей начальной точки, но не когда я запускаю его на полном изображении. Пожалуйста, помогите ...

# I have a large array node_space and a point of interest current_point
In [1]: node_space.shape                                                                         
Out[1]: (267, 321, 206)

In [2]: current_point                                                                            
Out[2]: (127, 171, 51)

# When I take a small cube and flood it from my point of interest flood works fine

In [3]: array = node_space[current_point[0]-1: current_point[0]+2, current_point[1]-1: current_point[1]+2, current_point[2]-1: current_point[2]+2]                                        

In [3]: mask = flood(array, (1,1,1))                                                             

In [4]: mask                                                                                     
Out[4]: 
array([[[False, False, False],
        [False, False,  True],
        [False, False, False]],

       [[False, False, False],
        [False,  True, False],
        [False, False, False]],

       [[False, False, False],
        [False, False, False],
        [False, False, False]]])

# However when I run The same operation on the larger image it fails
In [5]: mask = flood(node_space, current_point)    

In [6]: mask[current_point[0]-1: current_point[0]+2, current_point[1]-1: current_point[1]+2, current_point[2]-1: current_point[2]+2]                                                      
Out[6]: 
array([[[False, False, False],
        [False, False, False],
        [False, False, False]],

       [[False, False, False],
        [False, False, False],
        [False, False, False]],

       [[False, False, False],
        [False, False, False],
        [False, False, False]]])
...