Home | History | Annotate | Download | only in its

Lines Matching refs:numpy

21 import numpy
28 DEFAULT_YUV_TO_RGB_CCM = numpy.matrix([
33 DEFAULT_YUV_OFFSETS = numpy.array([0, 128, 128])
35 DEFAULT_GAMMA_LUT = numpy.array(
39 DEFAULT_INVGAMMA_LUT = numpy.array(
101 img = numpy.ndarray(shape=(2*h*w*4,), dtype='<f', buffer=cap["data"])
136 img: A raw-10 image, as a uint8 numpy array.
139 Image as a uint16 numpy array, with all row padding stripped.
146 msbs = numpy.delete(img, numpy.s_[4::5], 1)
147 msbs = msbs.astype(numpy.uint16)
148 msbs = numpy.left_shift(msbs, 2)
152 lsbs = numpy.right_shift(
153 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/4,4,2),3), 6)
158 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
190 img: A raw-12 image, as a uint8 numpy array.
193 Image as a uint16 numpy array, with all row padding stripped.
200 msbs = numpy.delete(img, numpy.s_[2::3], 1)
201 msbs = msbs.astype(numpy.uint16)
202 msbs = numpy.left_shift(msbs, 4)
206 lsbs = numpy.right_shift(
207 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/2,2,4),3), 4)
212 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
240 A tuple of float numpy arrays (one per plane), consisting of pixel
255 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
256 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
257 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
266 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
268 img = img.astype(numpy.float32).reshape(h,w) / white_level
376 r_plane,gr_plane,gb_plane,b_plane: Numpy arrays for each color plane
396 # Convert CCM from rational to float, as numpy arrays.
397 ccm = numpy.array(its.objects.rational_to_float(ccm)).reshape(3,3)
404 black_levels = numpy.array([b/white_level for b in [
408 gains = numpy.array([gains[i] for i in [0,1,3]])
411 img = numpy.dstack([r_plane,(gr_plane+gb_plane)/2.0,b_plane])
413 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
459 y = numpy.subtract(y_plane, yuv_off[0])
460 u = numpy.subtract(u_plane, yuv_off[1]).view(numpy.int8)
461 v = numpy.subtract(v_plane, yuv_off[2]).view(numpy.int8)
464 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
465 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
467 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
468 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
470 return rgb.astype(numpy.float32) / 255.0
485 a = numpy.array(img)
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, "")
526 y = numpy.fromfile(f, numpy.uint8, w*h, "")
527 vu = numpy.fromfile(f, numpy.uint8, w*h/2, "")
545 Separate Y, U, and V images as float-1 Numpy arrays, pixels in [0,1].
551 y = numpy.fromfile(f, numpy.uint8, w*h, "")
552 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
553 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
554 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
555 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
556 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
566 A numpy array for the RGB image, with pixels in [0,1].
571 return numpy.array(img).reshape(h,w,3) / 255.0
595 img: Numpy float image array, with pixel values in [0,1].
596 lut: Numpy table encoding a LUT, mapping 16b integer values.
605 return (lut[(img * m).astype(numpy.uint16)] / m).astype(numpy.float32)
619 img: Numpy float image array, with pixel values in [0,1].
620 mat: Numpy 3x3 matrix.
623 The numpy float-3 image array resulting from the matrix mult.
627 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
628 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
637 img: Numpy float image array, with pixel values in [0,1].
659 img: Numpy float image array, with pixel values in [0,1].
667 means.append(numpy.mean(img[:,:,i], dtype=numpy.float64))
675 img: Numpy float image array, with pixel values in [0,1].
683 variances.append(numpy.var(img[:,:,i], dtype=numpy.float64))
691 img: Numpy float image array, with pixel values in [0,1].
707 img: Numpy float image array, with pixel values in [0,1].
715 grads.append(numpy.amax(numpy.gradient(img[:, :, i])))
720 """Save a float-3 numpy array image to a file.
732 img: Numpy image array data.
740 Image.fromarray((img * 255.0).astype(numpy.uint8), "RGB").save(fname)
742 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
778 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)
786 img: Numpy float RGB/luma image array, with pixel values in [0,1].
799 [gy, gx] = numpy.gradient(luma)
800 return numpy.average(numpy.sqrt(gy*gy + gx*gx))
807 img: 2-D numpy array of image values
811 return (img - numpy.amin(img))/(numpy.amax(img) - numpy.amin(img))
836 img: 2-D numpy array of image values
842 img_out = numpy.fliplr(numpy.flipud(img_out))
887 mat = numpy.array([[1,2,3], [4,5,6], [7,8,9]])
888 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)
902 lut = numpy.array([2*i for i in xrange(65536)])
903 x = numpy.array([0.1,0.2,0.3]).reshape(1,1,3)
924 img_check = numpy.array(check_list).reshape(H, W)
930 val = numpy.binary_repr(check_list[row_start+pixel], 10)
935 chunk_raw10 = numpy.array(packed, dtype="uint8").reshape(1, 5)
939 img_raw10 = numpy.vstack((img_raw10, chunk_raw10))
941 self.assertTrue(numpy.array_equal(unpack_raw10_image(img_raw10),