Merge pull request #9265 from alalek:python_stitching

This commit is contained in:
Alexander Alekhin 2017-07-31 12:02:18 +00:00
commit 65519ab786
2 changed files with 21 additions and 1 deletions

View File

@ -149,7 +149,7 @@ public:
{
if( data != 0 )
{
CV_Error(Error::StsAssert, "The data should normally be NULL!");
// issue #6969: CV_Error(Error::StsAssert, "The data should normally be NULL!");
// probably this is safe to do in such extreme case
return stdAllocator->allocate(dims0, sizes, type, data, step, flags, usageFlags);
}

View 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))