numpy - matrix multiple 3x3 and 100x100x3 arrays?

前端 未结 2 455
迷失自我
迷失自我 2020-12-21 18:01

I have the following:

import numpy as np

XYZ_to_sRGB_mat_D50 = np.asarray([
    [3.1338561, -1.6168667, -0.4906146],
    [-0.9787684, 1.9161415, 0.0334540],         


        
2条回答
  •  清酒与你
    2020-12-21 18:42

    You probably simply want this:

    XYZ_2.dot(XYZ_to_sRGB_mat_D50.T)
    

    np.matmul(XYZ_to_sRGB_mat_D50, XYZ_1) is equivalent to XYZ_1.dot(XYZ_to_sRGB_mat_D50.T), you can then simply broadcast the operation to a 100 x 100 x 3 matrix.

提交回复
热议问题