def load_image(filename): if filename.endswith('.pgm'): fake_img = cuav_util.PGM(filename) return fake_img.array img = cv.LoadImage(filename) array = numpy.asarray(cv.GetMat(img)) grey = numpy.zeros((960, 1280), dtype='uint8') scanner.rebayer(array, grey) return grey
def load_image(filename): if filename.endswith(".pgm"): fake_img = cuav_util.PGM(filename) return fake_img.array img = cv.LoadImage(filename) array = numpy.asarray(cv.GetMat(img)) grey = numpy.zeros((960, 1280), dtype="uint8") scanner.rebayer(array, grey) return grey
def load_fake_image(filename): print "Loading mock file: %s" % filename if filename.endswith('.pgm'): return cuav_util.PGM(filename) img = cuav_util.LoadImage(filename) array = numpy.ascontiguousarray(cv.GetMat(img)) grey = numpy.zeros((image_height, image_width), dtype='uint8') scanner.rebayer(array, grey) return array