def inner_shape(source, compare): source_blobs = algorithm.get_blobs(algorithm.find_regions(source)) compare_blobs = algorithm.get_blobs(algorithm.find_regions(compare)) source_inner = source_blobs[algorithm.get_center(source_blobs)] compare_inner = compare_blobs[algorithm.get_center(compare_blobs)] return equality(source_inner, compare_inner)
def outer_shape(source, compare): source_blobs = algorithm.get_blobs(algorithm.find_regions(source)) compare_blobs = algorithm.get_blobs(algorithm.find_regions(compare)) if len(source_blobs) < 2 or len(compare_blobs) < 2: return None else: source_inner = algorithm.get_center(source_blobs) compare_inner = algorithm.get_center(compare_blobs) source_blobs.pop(source_inner) compare_blobs.pop(compare_inner) source_outer = algorithm.write_blobs(source_blobs) compare_outer = algorithm.write_blobs(compare_blobs) return equality(source_outer, compare_outer)