Create 3D Object out of 3 views

2019-02-27 13:53发布

I'd like to calculate an 3D object out of the 3 views. The principle is shown in following figure. object with 3 views

Each view is stored in a 2 dimensional matrix with binary values representing the object. The 3D object should be stored in a 3 dimensional matrix also with binary values (True: this pixel is representing object mass, False: this pixel is white space). How can I realize this with simply numpy matrix operations?

The three views a,b and c can for example look like [[0,0,0,0],[0,1,1,0],[0,1,1,0],[0,0,0,0]].

1条回答
贪生不怕死
2楼-- · 2019-02-27 14:19

If your views are a, b, c then:

result = a[None, :, :] & b[:, None, :] & c[:, :, None]

Shuffle round the axes to suit the input

a, b and c are assumed to be of the form:

np.array([[0,0,0,0],[0,1,1,0],[0,1,1,0],[0,0,0,0]], dtype=np.bool)
查看更多
登录 后发表回答