Now I have a 3-dimension np.array [height, weight, 3]. (It is a image) And I want to implement an RGB -> YUV algorithm myself RGB2YUV. However, iterating from each pixel and applying the transform is too slow.
for x in xrange(height):
for y in xrange(weight):
img[x,y] = mat_1 * img[x,y]
Is there any way to use some built_in method implementing this?