dot * 还是mutiply

#%%
import numpy as np
T_total1 = np.array([[ 0.00680154,  0.0406899,  -0.99914863,  0.367304], # 场景2的10.png 橙色物体校准 矩阵乘,公式校准后
                                [-0.99264958, -0.12046085, -0.01166302,  0.45615918],
                                [-0.12083286,  0.9918838,   0.03957153,  0.2620962],
                                [ 0.   ,       0.    ,      0.     ,     1.        ]])

T_total2 = np.array([[ 0.00680154,  0.0406899,  -0.99914863,  0.367304], # 场景2的10.png 橙色物体校准 矩阵乘,公式校准后
                                [-0.99264958, -0.12046085, -0.01166302,  0.45615918],
                                [-0.12083286,  0.9918838,   0.03957153,  0.2620962],
                                [ 0.   ,       0.    ,      0.     ,     1.        ]])

res_array_x = T_total1*T_total2
res_array_dot = np.dot(T_total1, T_total2)
res_array_mut = np.multiply(T_total1, T_total2)
print('res_array_x:', res_array_x) #点乘
print('res_array_dot:',res_array_dot)#矩阵乘
print('res_array_mut:',res_array_mut)#点乘
T_total1_mat = np.mat(T_total1)

T_total2_mat = np.mat(T_total2)
mat_res_array_x = T_total1_mat*T_total2_mat
mat_res_array_dot = np.dot(T_total1_mat, T_total2_mat)
mat_res_array_mut = np.multiply(T_total1_mat, T_total2_mat)
print('mat_res_array_x:', mat_res_array_x)#矩阵乘
print('mat_res_array_dot:',mat_res_array_dot)#矩阵乘
print('mat_res_array_mut:',mat_res_array_mut)#点乘
#%% 运行结果
res_array_x: [[4.62609464e-05 1.65566796e-03 9.98297985e-01 1.34912228e-01]
 [9.85353189e-01 1.45108164e-02 1.36026036e-04 2.08081197e-01]
 [1.46005801e-02 9.83833473e-01 1.56590599e-03 6.86944181e-02]
 [0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]]
res_array_dot: [[ 0.08038544 -0.99566413 -0.04680816  0.12649025]
 [ 0.11423314 -0.03744836  0.99274788  0.03354886]
 [-0.99019643 -0.08514948  0.11072753  0.68054226]
 [ 0.          0.          0.          1.        ]]
res_array_mut: [[4.62609464e-05 1.65566796e-03 9.98297985e-01 1.34912228e-01]
 [9.85353189e-01 1.45108164e-02 1.36026036e-04 2.08081197e-01]
 [1.46005801e-02 9.83833473e-01 1.56590599e-03 6.86944181e-02]
 [0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]]
mat_res_array_x: [[ 0.08038544 -0.99566413 -0.04680816  0.12649025]
 [ 0.11423314 -0.03744836  0.99274788  0.03354886]
 [-0.99019643 -0.08514948  0.11072753  0.68054226]
 [ 0.          0.          0.          1.        ]]
mat_res_array_dot: [[ 0.08038544 -0.99566413 -0.04680816  0.12649025]
 [ 0.11423314 -0.03744836  0.99274788  0.03354886]
 [-0.99019643 -0.08514948  0.11072753  0.68054226]
 [ 0.          0.          0.          1.        ]]
mat_res_array_mut: [[4.62609464e-05 1.65566796e-03 9.98297985e-01 1.34912228e-01]
 [9.85353189e-01 1.45108164e-02 1.36026036e-04 2.08081197e-01]
 [1.46005801e-02 9.83833473e-01 1.56590599e-03 6.86944181e-02]
 [0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值