Path: blob/master/modules/python/test/test_stitching.py
16337 views
#!/usr/bin/env python1import cv2 as cv23from tests_common import NewOpenCVTests45class stitching_test(NewOpenCVTests):67def test_simple(self):89img1 = self.get_sample('stitching/a1.png')10img2 = self.get_sample('stitching/a2.png')1112stitcher = cv.createStitcher(False)13(_result, pano) = stitcher.stitch((img1, img2))1415#cv.imshow("pano", pano)16#cv.waitKey()1718self.assertAlmostEqual(pano.shape[0], 685, delta=100, msg="rows: %r" % list(pano.shape))19self.assertAlmostEqual(pano.shape[1], 1025, delta=100, msg="cols: %r" % list(pano.shape))2021if __name__ == '__main__':22NewOpenCVTests.bootstrap()232425