Lines Matching refs:h

66     h = cap["height"]
74 y = cap["data"][0:w*h]
75 u = cap["data"][w*h:w*h*5/4]
76 v = cap["data"][w*h*5/4:w*h*6/4]
77 return convert_yuv420_planar_to_rgb_image(y, u, v, w, h)
85 y = cap["data"][0:w*h]
86 return convert_y8_to_rgb_image(y, w, h)
103 h = cap["height"]
104 img = numpy.ndarray(shape=(2*h*w*4,), dtype='<f', buffer=cap["data"])
105 analysis_image = img.reshape(2,h,w,4)
106 mean_image = analysis_image[0,:,:,:].reshape(h,w,4)
107 var_image = analysis_image[1,:,:,:].reshape(h,w,4)
123 w,h = cap["width"], cap["height"]
127 cap["data"] = unpack_raw10_image(cap["data"].reshape(h,w*5/4))
147 h = img.shape[0]
152 msbs = msbs.reshape(h,w)
154 lsbs = img[::, 4::5].reshape(h,w/4)
156 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/4,4,2),3), 6)
158 lsbs = lsbs.reshape(h,w/4,4)[:,:,::-1]
159 lsbs = lsbs.reshape(h,w)
161 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
177 w,h = cap["width"], cap["height"]
181 cap["data"] = unpack_raw12_image(cap["data"].reshape(h,w*3/2))
201 h = img.shape[0]
206 msbs = msbs.reshape(h,w)
208 lsbs = img[::, 2::3].reshape(h,w/2)
210 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/2,2,4),3), 4)
212 lsbs = lsbs.reshape(h,w/2,2)[:,:,::-1]
213 lsbs = lsbs.reshape(h,w)
215 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
247 h = cap["height"]
255 y = cap["data"][0:w*h]
256 u = cap["data"][w*h:w*h*5/4]
257 v = cap["data"][w*h*5/4:w*h*6/4]
258 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
259 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
260 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
262 rgb = decompress_jpeg_to_rgb_image(cap["data"]).reshape(w*h*3)
263 return (rgb[::3].reshape(h,w,1),
264 rgb[1::3].reshape(h,w,1),
265 rgb[2::3].reshape(h,w,1))
269 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
270 buffer=cap["data"][0:w*h*2])
271 img = img.astype(numpy.float32).reshape(h,w) / white_level
291 if w == wfull and h == hfull:
295 h = hcrop
296 elif w == wcrop and h == hcrop:
302 imgs = [img[::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
303 img[::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1),
304 img[1::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
305 img[1::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1)]
413 h,w = r_plane.shape[:2]
415 img = (((img.reshape(h,w,3) - black_levels) * scale) * gains).clip(0.0,1.0)
416 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
445 w, h, argument
465 u = u.reshape(h/2, w/2).repeat(2, axis=1).repeat(2, axis=0)
466 v = v.reshape(h/2, w/2).repeat(2, axis=1).repeat(2, axis=0)
467 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
468 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
469 flt.reshape(w*h*3)[:] = yuv.reshape(h*w*3)[:]
470 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
471 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
472 rgb.reshape(w*h*3)[:] = flt.reshape(w*h*3)[:]
475 def convert_y8_to_rgb_image(y_plane, w, h): argument
487 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
488 rgb.reshape(w*h*3)[:] = y3.reshape(w*h*3)[:]
502 h = img.size[1]
506 return a.reshape(h,w,3) / 255.0
509 return a.reshape(h*w).repeat(3).reshape(h,w,3) / 255.0
515 w, h, argument
539 y = numpy.fromfile(f, numpy.uint8, w*h, "")
540 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
541 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
544 y = numpy.fromfile(f, numpy.uint8, w*h, "")
545 vu = numpy.fromfile(f, numpy.uint8, w*h/2, "")
551 y,u,v,w,h,ccm_yuv_to_rgb,yuv_off)
554 def load_yuv420_planar_to_yuv_planes(yuv_fname, w, h): argument
569 y = numpy.fromfile(f, numpy.uint8, w*h, "")
570 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
571 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
572 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
573 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
574 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
588 h = img.size[1]
589 return numpy.array(img).reshape(h,w,3) / 255.0
643 h = img.shape[0]
645 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
646 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
647 ).reshape(w*h*3)[:]
756 (h, w, chans) = img.shape
760 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
784 h,w,chans = img.shape
787 h = (h/f)*f
789 img = img[0:h:,0:w:,::]
792 ch = img.reshape(h*w*chans)[i::chans].reshape(h,w)
793 ch = ch.reshape(h,w/f,f).mean(2).reshape(h,w/f)
794 ch = ch.T.reshape(w/f,h/f,f).mean(2).T.reshape(h/f,w/f)
795 chs.append(ch.reshape(h*w/(f*f)))
796 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)