コード例 #1
0
def merge_images(img0, img1, img2):
	""" takes images in bgr order """
	images = profile.evaluate(lambda: load_images([img0, img1, img2]), "Image loading")
	for i in images:
		assert i.depth == cv.IPL_DEPTH_8U
	images = profile.evaluate(lambda: resize(images), "Image resizing")
	mergedImage = cv.CreateImage(min_size(images), cv.IPL_DEPTH_8U, 3)
	profile.evaluate(lambda: cv.Merge(images[0], images[1], images[2], None,
		mergedImage), "Image merging")

	return mergedImage
コード例 #2
0
def merge_images(img0, img1, img2):
    """ takes images in bgr order """
    images = profile.evaluate(lambda: load_images([img0, img1, img2]),
                              "Image loading")
    for i in images:
        assert i.depth == cv.IPL_DEPTH_8U
    images = profile.evaluate(lambda: resize(images), "Image resizing")
    mergedImage = cv.CreateImage(min_size(images), cv.IPL_DEPTH_8U, 3)
    profile.evaluate(
        lambda: cv.Merge(images[0], images[1], images[2], None, mergedImage),
        "Image merging")

    return mergedImage
コード例 #3
0
def merge_to_file(img0, img1, img2, filePath):
    """ Takes images in rgb order """
    img = merge_images(img2, img1, img0)
    profile.evaluate(lambda: cv.SaveImage(filePath, img), "Image saving")
コード例 #4
0
def merge_to_file(img0, img1, img2, filePath):
	""" Takes images in rgb order """
	img = merge_images(img2, img1, img0)
	profile.evaluate(lambda: cv.SaveImage(filePath, img), "Image saving")