mirror of
https://github.com/opencv/opencv.git
synced 2025-01-22 17:43:12 +08:00
1ba7c728a6
[evolution] Stitching for OpenCV 4.0 * stitching: wrap Stitcher::create for bindings * provide method for consistent stitcher usage across languages * samples: add python stitching sample * port cpp stitching sample to python * stitching: consolidate Stitcher create methods * remove Stitcher::createDefault, it returns Stitcher, not Ptr<Stitcher> -> inconsistent API * deprecate cv::createStitcher and cv::createStitcherScans in favor of Stitcher::create * stitching: avoid anonymous enum in Stitcher * ORIG_RESOL should be double * add documentatiton * stitching: improve documentation in Stitcher * stitching: expose estimator in Stitcher * remove ABI hack * stitching: drop try_use_gpu flag * OCL will be used automatically through T-API in OCL-enable paths * CUDA won't be used unless user sets CUDA-enabled classes manually * stitching: drop FeaturesFinder * use Feature2D instead of FeaturesFinder * interoperability with features2d module * detach from dependency on xfeatures2d * features2d: fix compute and detect to work with UMat vectors * correctly pass UMats as UMats to allow OCL paths * support vector of UMats as output arg * stitching: use nearest interpolation for resizing masks * fix warnings
24 lines
678 B
Python
24 lines
678 B
Python
#!/usr/bin/env python
|
|
import cv2 as cv
|
|
|
|
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 = cv.Stitcher.create(cv.Stitcher_PANORAMA)
|
|
(_result, pano) = stitcher.stitch((img1, img2))
|
|
|
|
#cv.imshow("pano", pano)
|
|
#cv.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))
|
|
|
|
if __name__ == '__main__':
|
|
NewOpenCVTests.bootstrap()
|