Home | History | Annotate | Download | only in its

Lines Matching full:numpy

22 import numpy
29 DEFAULT_YUV_TO_RGB_CCM = numpy.matrix([
34 DEFAULT_YUV_OFFSETS = numpy.array([0, 128, 128])
36 DEFAULT_GAMMA_LUT = numpy.array(
40 DEFAULT_INVGAMMA_LUT = numpy.array(
108 img: A raw-10 image, as a uint8 numpy array.
111 Image as a uint16 numpy array, with all row padding stripped.
118 msbs = numpy.delete(img, numpy.s_[4::5], 1)
119 msbs = msbs.astype(numpy.uint16)
120 msbs = numpy.left_shift(msbs, 2)
124 lsbs = numpy.right_shift(
125 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/4,4,2),3), 6)
128 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
153 A tuple of float numpy arrays (one per plane), consisting of pixel
165 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
166 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
167 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
176 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
178 img = img.astype(numpy.float32).reshape(h,w) / white_level
247 r_plane,gr_plane,gb_plane,b_plane: Numpy arrays for each color plane
268 # Convert CCM from rational to float, as numpy arrays.
269 ccm = numpy.array(its.objects.rational_to_float(ccm)).reshape(3,3)
276 black_levels = numpy.array([b/white_level for b in [
280 gains = numpy.array([gains[i] for i in [0,1,3]])
283 img = numpy.dstack([r_plane,(gr_plane+gb_plane)/2.0,b_plane])
285 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
306 y = numpy.subtract(y_plane, yuv_off[0])
307 u = numpy.subtract(u_plane, yuv_off[1]).view(numpy.int8)
308 v = numpy.subtract(v_plane, yuv_off[2]).view(numpy.int8)
311 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
312 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
314 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
315 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
317 return rgb.astype(numpy.float32) / 255.0
336 y = numpy.fromfile(f, numpy.uint8, w*h, "")
337 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
338 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
350 Separate Y, U, and V images as float-1 Numpy arrays, pixels in [0,1].
356 y = numpy.fromfile(f, numpy.uint8, w*h, "")
357 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
358 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
359 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
360 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
361 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
370 A numpy array for the RGB image, with pixels in [0,1].
375 return numpy.array(img).reshape(h,w,3) / 255.0
398 img: Numpy float image array, with pixel values in [0,1].
399 lut: Numpy table encoding a LUT, mapping 16b integer values.
408 return (lut[(img * m).astype(numpy.uint16)] / m).astype(numpy.float32)
421 img: Numpy float image array, with pixel values in [0,1].
422 mat: Numpy 3x3 matrix.
425 The numpy float-3 image array resulting from the matrix mult.
429 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
430 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
438 img: Numpy float image array, with pixel values in [0,1].
456 img: Numpy float image array, with pixel values in [0,1].
464 means.append(numpy.mean(img[:,:,i], dtype=numpy.float64))
471 img: Numpy float image array, with pixel values in [0,1].
479 variances.append(numpy.var(img[:,:,i], dtype=numpy.float64))
483 """Save a float-3 numpy array image to a file.
495 img: Numpy image array data.
503 Image.fromarray((img * 255.0).astype(numpy.uint8), "RGB").save(fname)
505 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
540 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)
573 img: Input image, as a numpy array with pixels in [0,1].
694 gridimg = numpy.zeros([4*(32+2), 6*(32+2), 3])
723 mat = numpy.array([[1,2,3],[4,5,6],[7,8,9]])
724 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)
738 lut = numpy.array([2*i for i in xrange(65536)])
739 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)