Python | Numpy array images transformations
问题 I have a Numpy image array with shape (1000, 50, 100, 3) ( class 'numpy.ndarray' ) which is containing 1000 images RGB (height = 50, width = 100, channels = 3). I want to first convert the RGB values to YUV values and rescale them to obtain yuv values. A prototypical implementation of a pixel-wise converter is given below. My question : Is there a simple way how I can carry out this transformation? def yuv(_pixel): R, G, B = _pixel[0], _pixel[1], _pixel[2] Y = 0.299 * R + 0.587 * G + 0.114 *