Home | History | Annotate | Download | only in its

Lines Matching refs:numpy

22 import numpy
26 DEFAULT_YUV_TO_RGB_CCM = numpy.matrix([
31 DEFAULT_YUV_OFFSETS = numpy.array([0, 128, 128])
33 DEFAULT_GAMMA_LUT = numpy.array(
36 DEFAULT_INVGAMMA_LUT = numpy.array(
58 y = numpy.fromfile(f, numpy.uint8, w*h, "")
59 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
60 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
61 y = numpy.subtract(y, yuv_off[0])
62 u = numpy.subtract(u, yuv_off[1]).view(numpy.int8)
63 v = numpy.subtract(v, yuv_off[2]).view(numpy.int8)
66 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
67 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
69 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
70 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
72 return rgb.astype(numpy.float32) / 255.0
83 Separate Y, U, and V images as float-1 Numpy arrays, pixels in [0,1].
89 y = numpy.fromfile(f, numpy.uint8, w*h, "")
90 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
91 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
92 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
93 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
94 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
117 img: Numpy float image array, with pixel values in [0,1].
118 lut: Numpy table encoding a LUT, mapping 16b integer values.
127 return (lut[(img * m).astype(numpy.uint16)] / m).astype(numpy.float32)
140 img: Numpy float image array, with pixel values in [0,1].
141 mat: Numpy 3x3 matrix.
144 The numpy float-3 image array resulting from the matrix mult.
148 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
149 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
157 img: Numpy float image array, with pixel values in [0,1].
175 img: Numpy float image array, with pixel values in [0,1].
183 means.append(numpy.mean(img[:,:,i], dtype=numpy.float64))
190 img: Numpy float image array, with pixel values in [0,1].
198 variances.append(numpy.var(img[:,:,i], dtype=numpy.float64))
202 """Save a float-3 numpy array image to a file.
214 img: Numpy image array data.
222 Image.fromarray((img * 255.0).astype(numpy.uint8), "RGB").save(fname)
224 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
245 mat = numpy.array([[1,2,3],[4,5,6],[7,8,9]])
246 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)
260 lut = numpy.array([2*i for i in xrange(65536)])
261 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)