2017-07-30 18:52:27 +08:00
|
|
|
#!/usr/bin/env python
|
2017-12-11 17:55:03 +08:00
|
|
|
import cv2 as cv
|
2017-07-30 18:52:27 +08:00
|
|
|
|
|
|
|
from tests_common import NewOpenCVTests
|
|
|
|
|
|
|
|
class stitching_test(NewOpenCVTests):
|
|
|
|
|
|
|
|
def test_simple(self):
|
|
|
|
|
|
|
|
img1 = self.get_sample('stitching/a1.png')
|
|
|
|
img2 = self.get_sample('stitching/a2.png')
|
|
|
|
|
2017-12-11 17:55:03 +08:00
|
|
|
stitcher = cv.createStitcher(False)
|
2017-09-03 19:17:15 +08:00
|
|
|
(_result, pano) = stitcher.stitch((img1, img2))
|
2017-07-30 18:52:27 +08:00
|
|
|
|
2017-12-11 17:55:03 +08:00
|
|
|
#cv.imshow("pano", pano)
|
|
|
|
#cv.waitKey()
|
2017-07-30 18:52:27 +08:00
|
|
|
|
|
|
|
self.assertAlmostEqual(pano.shape[0], 685, delta=100, msg="rows: %r" % list(pano.shape))
|
|
|
|
self.assertAlmostEqual(pano.shape[1], 1025, delta=100, msg="cols: %r" % list(pano.shape))
|
2017-09-03 20:01:25 +08:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
NewOpenCVTests.bootstrap()
|