mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 06:26:29 +08:00
python: stitching simple test
This commit is contained in:
parent
6ae5a9f07a
commit
15a6586062
20
modules/python/test/test_stitching.py
Normal file
20
modules/python/test/test_stitching.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
import cv2
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
stitcher = cv2.createStitcher(False)
|
||||||
|
(result, pano) = stitcher.stitch((img1, img2))
|
||||||
|
|
||||||
|
#cv2.imshow("pano", pano)
|
||||||
|
#cv2.waitKey()
|
||||||
|
|
||||||
|
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))
|
Loading…
Reference in New Issue
Block a user