Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/python/test/test_stitching.py
16337 views
1
#!/usr/bin/env python
2
import cv2 as cv
3
4
from tests_common import NewOpenCVTests
5
6
class stitching_test(NewOpenCVTests):
7
8
def test_simple(self):
9
10
img1 = self.get_sample('stitching/a1.png')
11
img2 = self.get_sample('stitching/a2.png')
12
13
stitcher = cv.createStitcher(False)
14
(_result, pano) = stitcher.stitch((img1, img2))
15
16
#cv.imshow("pano", pano)
17
#cv.waitKey()
18
19
self.assertAlmostEqual(pano.shape[0], 685, delta=100, msg="rows: %r" % list(pano.shape))
20
self.assertAlmostEqual(pano.shape[1], 1025, delta=100, msg="cols: %r" % list(pano.shape))
21
22
if __name__ == '__main__':
23
NewOpenCVTests.bootstrap()
24
25