From 15a658606221be43db9f9397f2ac3eea9451a2bb Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 30 Jul 2017 13:52:27 +0300 Subject: [PATCH 1/2] python: stitching simple test --- modules/python/test/test_stitching.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/python/test/test_stitching.py diff --git a/modules/python/test/test_stitching.py b/modules/python/test/test_stitching.py new file mode 100644 index 0000000000..9a35357c7c --- /dev/null +++ b/modules/python/test/test_stitching.py @@ -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)) From 46f05f2db6a829e7123f6d37e16d3f0f2b8cf706 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 30 Jul 2017 13:54:54 +0300 Subject: [PATCH 2/2] python: disable assertion in NumpyAllocator --- modules/python/src2/cv2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index e0609dd570..be8965c6e0 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -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); }