Lines Matching refs:h
63 h = cap["height"]
71 y = cap["data"][0:w*h]
72 u = cap["data"][w*h:w*h*5/4]
73 v = cap["data"][w*h*5/4:w*h*6/4]
74 return convert_yuv420_planar_to_rgb_image(y, u, v, w, h)
96 w,h = cap["width"], cap["height"]
100 cap["data"] = unpack_raw10_image(cap["data"].reshape(h,w*5/4))
119 h = img.shape[0]
124 msbs = msbs.reshape(h,w)
126 lsbs = img[::, 4::5].reshape(h,w/4)
128 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/4,4,2),3), 6)
129 lsbs = lsbs.reshape(h,w)
131 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
146 w,h = cap["width"], cap["height"]
150 cap["data"] = unpack_raw12_image(cap["data"].reshape(h,w*3/2))
169 h = img.shape[0]
174 msbs = msbs.reshape(h,w)
176 lsbs = img[::, 2::3].reshape(h,w/2)
178 numpy.packbits(numpy.unpackbits(lsbs).reshape(h,w/2,2,4),3), 4)
179 lsbs = lsbs.reshape(h,w)
181 img16 = numpy.bitwise_or(msbs, lsbs).reshape(h,w)
210 h = cap["height"]
218 y = cap["data"][0:w*h]
219 u = cap["data"][w*h:w*h*5/4]
220 v = cap["data"][w*h*5/4:w*h*6/4]
221 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
222 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
223 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
225 rgb = decompress_jpeg_to_rgb_image(cap["data"]).reshape(w*h*3)
226 return (rgb[::3].reshape(h,w,1),
227 rgb[1::3].reshape(h,w,1),
228 rgb[2::3].reshape(h,w,1))
232 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
233 buffer=cap["data"][0:w*h*2])
234 img = img.astype(numpy.float32).reshape(h,w) / white_level
254 if w == wfull and h == hfull:
258 h = hcrop
259 elif w == wcrop and h == hcrop:
265 imgs = [img[::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
266 img[::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1),
267 img[1::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
268 img[1::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1)]
368 h,w = r_plane.shape[:2]
370 img = (((img.reshape(h,w,3) - black_levels) * scale) * gains).clip(0.0,1.0)
371 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
375 w, h, argument
395 u = u.reshape(h/2, w/2).repeat(2, axis=1).repeat(2, axis=0)
396 v = v.reshape(h/2, w/2).repeat(2, axis=1).repeat(2, axis=0)
397 yuv = numpy.dstack([y, u.reshape(w*h), v.reshape(w*h)])
398 flt = numpy.empty([h, w, 3], dtype=numpy.float32)
399 flt.reshape(w*h*3)[:] = yuv.reshape(h*w*3)[:]
400 flt = numpy.dot(flt.reshape(w*h,3), ccm_yuv_to_rgb.T).clip(0, 255)
401 rgb = numpy.empty([h, w, 3], dtype=numpy.uint8)
402 rgb.reshape(w*h*3)[:] = flt.reshape(w*h*3)[:]
416 h = img.size[1]
420 return a.reshape(h,w,3) / 255.0
423 return a.reshape(h*w).repeat(3).reshape(h,w,3) / 255.0
428 w, h, argument
452 y = numpy.fromfile(f, numpy.uint8, w*h, "")
453 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
454 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
457 y = numpy.fromfile(f, numpy.uint8, w*h, "")
458 vu = numpy.fromfile(f, numpy.uint8, w*h/2, "")
464 y,u,v,w,h,ccm_yuv_to_rgb,yuv_off)
466 def load_yuv420_planar_to_yuv_planes(yuv_fname, w, h): argument
481 y = numpy.fromfile(f, numpy.uint8, w*h, "")
482 v = numpy.fromfile(f, numpy.uint8, w*h/4, "")
483 u = numpy.fromfile(f, numpy.uint8, w*h/4, "")
484 return ((y.astype(numpy.float32) / 255.0).reshape(h, w, 1),
485 (u.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1),
486 (v.astype(numpy.float32) / 255.0).reshape(h/2, w/2, 1))
499 h = img.size[1]
500 return numpy.array(img).reshape(h,w,3) / 255.0
552 h = img.shape[0]
554 img2 = numpy.empty([h, w, 3], dtype=numpy.float32)
555 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
556 ).reshape(w*h*3)[:]
626 (h, w, chans) = img.shape
630 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
653 h,w,chans = img.shape
656 h = (h/f)*f
658 img = img[0:h:,0:w:,::]
661 ch = img.reshape(h*w*chans)[i::chans].reshape(h,w)
662 ch = ch.reshape(h,w/f,f).mean(2).reshape(h,w/f)
663 ch = ch.T.reshape(w/f,h/f,f).mean(2).T.reshape(h/f,w/f)
664 chs.append(ch.reshape(h*w/(f*f)))
665 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)