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(
97 img = numpy.ndarray(shape=(2*h*w*4,), dtype='<f', buffer=cap["data"])
130 img: A raw-10 image, as a uint8 numpy array.
133 Image as a uint16 numpy array, with all row padding stripped.
140 msbs = numpy.delete(img, numpy.s_[4::5], 1)
141 msbs = msbs.astype(numpy.uint16)
142 msbs = numpy.left_shift(msbs, 2)
146 lsbs = numpy.right_shift(
147 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/4,4,2),3), 6)
150 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
180 img: A raw-12 image, as a uint8 numpy array.
183 Image as a uint16 numpy array, with all row padding stripped.
190 msbs = numpy.delete(img, numpy.s_[2::3], 1)
191 msbs = msbs.astype(numpy.uint16)
192 msbs = numpy.left_shift(msbs, 4)
196 lsbs = numpy.right_shift(
197 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/2,2,4),3), 4)
200 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
225 A tuple of float numpy arrays (one per plane), consisting of pixel
240 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
241 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
242 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
251 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
253 img = img.astype(numpy.float32).reshape(h,w) / white_level
352 r_plane,gr_plane,gb_plane,b_plane: Numpy arrays for each color plane
372 # Convert CCM from rational to float, as numpy arrays.
373 ccm = numpy.array(its.objects.rational_to_float(ccm)).reshape(3,3)
380 black_levels = numpy.array([b/white_level for b in [
384 gains = numpy.array([gains[i] for i in [0,1,3]])
387 img = numpy.dstack([r_plane,(gr_plane+gb_plane)/2.0,b_plane])
389 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
432 y = numpy.subtract(y_plane, yuv_off[0])
433 u = numpy.subtract(u_plane, yuv_off[1]).view(numpy.int8)
434 v = numpy.subtract(v_plane, yuv_off[2]).view(numpy.int8)
437 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
438 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
440 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
441 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
443 return rgb.astype(numpy.float32) / 255.0
457 a = numpy.array(img)
492 y = numpy.fromfile(f, numpy.uint8, w*h, "")
493 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
494 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
497 y = numpy.fromfile(f, numpy.uint8, w*h, "")
498 vu = numpy.fromfile(f, numpy.uint8, w*h/2, "")
515 Separate Y, U, and V images as float-1 Numpy arrays, pixels in [0,1].
521 y = numpy.fromfile(f, numpy.uint8, w*h, "")
522 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
523 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
524 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
525 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
526 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
535 A numpy array for the RGB image, with pixels in [0,1].
540 return numpy.array(img).reshape(h,w,3) / 255.0
563 img: Numpy float image array, with pixel values in [0,1].
564 lut: Numpy table encoding a LUT, mapping 16b integer values.
573 return (lut[(img * m).astype(numpy.uint16)] / m).astype(numpy.float32)
586 img: Numpy float image array, with pixel values in [0,1].
587 mat: Numpy 3x3 matrix.
590 The numpy float-3 image array resulting from the matrix mult.
594 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
595 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
603 img: Numpy float image array, with pixel values in [0,1].
621 img: Numpy float image array, with pixel values in [0,1].
629 means.append(numpy.mean(img[:,:,i], dtype=numpy.float64))
636 img: Numpy float image array, with pixel values in [0,1].
644 variances.append(numpy.var(img[:,:,i], dtype=numpy.float64))
651 img: Numpy float image array, with pixel values in [0,1].
663 """Save a float-3 numpy array image to a file.
675 img: Numpy image array data.
683 Image.fromarray((img * 255.0).astype(numpy.uint8), "RGB").save(fname)
685 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
720 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)
727 img: Numpy float RGB/luma image array, with pixel values in [0,1].
739 [gy, gx] = numpy.gradient(luma)
740 return numpy.average(numpy.sqrt(gy*gy + gx*gx))
758 mat = numpy.array([[1,2,3],[4,5,6],[7,8,9]])
759 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)
773 lut = numpy.array([2*i for i in xrange(65536)])
774 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)