I have XYZ dataset like that:
[[ 15.4999257 20.91432805 8.15938343]
[ 38.47211872 41.38471882 4.41641215]
[ 8.42304194 10.26972173 4.58244444]
[ 59.15345728 65.6834669 42.20671404]
[ 48.21549352 50.67621445 7.84460441]
[ 28.5987903 29.48986333 25.78866701]
[ 16.37042029 11.17896503 20.92325834]...]
I want to change it to RGB 0-255:
import numpy as np
XYZ_to_RGB_matrix = [
[3.24062548, -1.53720797, -0.49862860],
[-0.96893071, 1.87575606, 0.04151752],
[0.05571012, -0.20402105, 1.05699594]]
my_rgb = (np.dot(XYZ_to_RGB_matrix, xyz_test) * 255).astype('uint8')
xyz_test is only one row array from XYZ dataset,
However, I found the result didn't correspond the right label,
for example, XYZ:[ 15.4999257 20.91432805 8.15938343] its label is green leaf
but my rgb result is [244 116 51] it is not green, so is there some mistakes in my code?