I am having an image described with a Numpy array, i.e. each pixel is an array [r,g,b]. Now, I need to transform it to YUV using matrix multiplication and trying not to use loops.

self.yuv=self.rgb

self.yuv=dot([[ 0.299, 0.587, 0.114 ],

[-0.14713, -0.28886, 0.436 ],

[ 0.615, -0.51499, -0.10001]],

self.yuv[:,:])

I get the error - objects not aligned. I guess that's because of self. yuv[i,j] is not a perpendicular vector.