Skip to content

Commit 65519ab

Browse files
committed
Merge pull request opencv#9265 from alalek:python_stitching
2 parents bdb6b45 + 46f05f2 commit 65519ab

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

modules/python/src2/cv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class NumpyAllocator : public MatAllocator
149149
{
150150
if( data != 0 )
151151
{
152-
CV_Error(Error::StsAssert, "The data should normally be NULL!");
152+
// issue #6969: CV_Error(Error::StsAssert, "The data should normally be NULL!");
153153
// probably this is safe to do in such extreme case
154154
return stdAllocator->allocate(dims0, sizes, type, data, step, flags, usageFlags);
155155
}

modules/python/test/test_stitching.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python
2+
import cv2
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 = cv2.createStitcher(False)
14+
(result, pano) = stitcher.stitch((img1, img2))
15+
16+
#cv2.imshow("pano", pano)
17+
#cv2.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))

0 commit comments

Comments
 (0)