从3个视图中创建3D对象 [英] Create 3D Object out of 3 views
问题描述
我想从3个视图中计算一个3D对象。原理如下图所示。
每个视图都存储在具有二进制值的2维矩阵表示对象。 3D对象应该以二进制值存储在3维矩阵中(True:该像素代表对象质量,False:该像素是白色空间)。
如何通过简单的矩阵运算来实现这一点?
[[0,0,0,0],[0,1,1,0],[0,1,1,0],[0,0,0, 0]]
。 c 然后:
result = a [None,:,:]& b [:,无,:]& c [:::,None]
绕轴旋转以适应输入
a
, b
和 c
被假定为以下形式:
np.array([[0,0,0,0] ,[0,1,1,0],[0,1,1,0],[0,0,0,0]],dtype = np.bool)
I'd like to calculate an 3D object out of the 3 views. The principle is shown in following figure.
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]]
.
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)
这篇关于从3个视图中创建3D对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!