Lines Matching refs:img

102     img = numpy.ndarray(shape=(2*h*w*4,), dtype='<f', buffer=cap["data"])
103 analysis_image = img.reshape(2,h,w,4)
128 def unpack_raw10_image(img): argument
140 if img.shape[1] % 5 != 0:
142 w = img.shape[1]*4/5
143 h = img.shape[0]
145 msbs = numpy.delete(img, numpy.s_[4::5], 1)
150 lsbs = img[::, 4::5].reshape(h,w/4)
178 def unpack_raw12_image(img): argument
190 if img.shape[1] % 3 != 0:
192 w = img.shape[1]*2/3
193 h = img.shape[0]
195 msbs = numpy.delete(img, numpy.s_[2::3], 1)
200 lsbs = img[::, 2::3].reshape(h,w/2)
258 img = numpy.ndarray(shape=(h*w,), dtype='<u2',
260 img = img.astype(numpy.float32).reshape(h,w) / white_level
282 img = img[ycrop:ycrop+hcrop,xcrop:xcrop+wcrop]
291 imgs = [img[::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
292 img[::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1),
293 img[1::2].reshape(w*h/2)[::2].reshape(h/2,w/2,1),
294 img[1::2].reshape(w*h/2)[1::2].reshape(h/2,w/2,1)]
400 img = numpy.dstack([r_plane,(gr_plane+gb_plane)/2.0,b_plane])
401 img = (((img.reshape(h,w,3) - black_levels) * scale) * gains).clip(0.0,1.0)
402 img = numpy.dot(img.reshape(w*h,3), ccm.T).reshape(h,w,3).clip(0.0,1.0)
403 return img
468 img = Image.open(fname)
469 w = img.size[0]
470 h = img.size[1]
471 a = numpy.array(img)
551 img = Image.open(cStringIO.StringIO(jpeg_buffer))
552 w = img.size[0]
553 h = img.size[1]
554 return numpy.array(img).reshape(h,w,3) / 255.0
556 def apply_lut_to_image(img, lut): argument
587 return (lut[(img * m).astype(numpy.uint16)] / m).astype(numpy.float32)
589 def apply_matrix_to_image(img, mat): argument
606 h = img.shape[0]
607 w = img.shape[1]
609 img2.reshape(w*h*3)[:] = (numpy.dot(img.reshape(h*w, 3), mat.T)
613 def get_image_patch(img, xnorm, ynorm, wnorm, hnorm): argument
623 hfull = img.shape[0]
624 wfull = img.shape[1]
629 return img[ytile:ytile+htile,xtile:xtile+wtile,:].copy()
631 def compute_image_means(img): argument
641 chans = img.shape[2]
643 means.append(numpy.mean(img[:,:,i], dtype=numpy.float64))
646 def compute_image_variances(img): argument
656 chans = img.shape[2]
658 variances.append(numpy.var(img[:,:,i], dtype=numpy.float64))
661 def compute_image_snrs(img): argument
670 means = compute_image_means(img)
671 variances = compute_image_variances(img)
676 def write_image(img, fname, apply_gamma=False): argument
694 img = apply_lut_to_image(img, DEFAULT_GAMMA_LUT)
695 (h, w, chans) = img.shape
697 Image.fromarray((img * 255.0).astype(numpy.uint8), "RGB").save(fname)
699 img3 = (img * 255.0).astype(numpy.uint8).repeat(3).reshape(h,w,3)
704 def downscale_image(img, f): argument
722 h,w,chans = img.shape
727 img = img[0:h:,0:w:,::]
730 ch = img.reshape(h*w*chans)[i::chans].reshape(h,w)
734 img = numpy.vstack(chs).T.reshape(h/f,w/f,chans)
735 return img
738 def compute_image_sharpness(img): argument
748 chans = img.shape[2]
751 luma = img[:, :, 0]
753 luma = 0.299 * img[:,:,0] + 0.587 * img[:,:,1] + 0.114 * img[:,:,2]
758 def normalize_img(img): argument
766 return (img - numpy.amin(img))/(numpy.amax(img) - numpy.amin(img))
768 def flip_mirror_img_per_argv(img): argument
776 img_out = img