Skip to content

Commit 3b337a1

Browse files
committed
Merge pull request opencv#18018 from danielenricocahall:add-compose-panorama-python-binding
2 parents 2c32cb7 + f2ca7e6 commit 3b337a1

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

modules/stitching/include/opencv2/stitching.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class CV_EXPORTS_W Stitcher
264264
@param pano Final pano.
265265
@return Status code.
266266
*/
267-
Status composePanorama(InputArrayOfArrays images, OutputArray pano);
267+
CV_WRAP Status composePanorama(InputArrayOfArrays images, OutputArray pano);
268268

269269
/** @overload */
270270
CV_WRAP Status stitch(InputArrayOfArrays images, OutputArray pano);

modules/stitching/misc/python/test/test_stitching.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,36 @@ def test_simple(self):
1919
self.assertAlmostEqual(pano.shape[0], 685, delta=100, msg="rows: %r" % list(pano.shape))
2020
self.assertAlmostEqual(pano.shape[1], 1025, delta=100, msg="cols: %r" % list(pano.shape))
2121

22+
23+
class stitching_compose_panorama_test_no_args(NewOpenCVTests):
24+
25+
def test_simple(self):
26+
27+
img1 = self.get_sample('stitching/a1.png')
28+
img2 = self.get_sample('stitching/a2.png')
29+
30+
stitcher = cv.createStitcher(False)
31+
32+
stitcher.estimateTransform((img1, img2))
33+
34+
result, _ = stitcher.composePanorama()
35+
36+
assert result == 0
37+
38+
39+
class stitching_compose_panorama_args(NewOpenCVTests):
40+
41+
def test_simple(self):
42+
43+
img1 = self.get_sample('stitching/a1.png')
44+
img2 = self.get_sample('stitching/a2.png')
45+
46+
stitcher = cv.createStitcher(False)
47+
48+
stitcher.estimateTransform((img1, img2))
49+
result, _ = stitcher.composePanorama((img1, img2))
50+
51+
assert result == 0
52+
2253
if __name__ == '__main__':
2354
NewOpenCVTests.bootstrap()

0 commit comments

Comments
 (0)