简体   繁体   English

python中opencv缝合器类的高级实现

[英]High level implementation of opencv stitcher class in python

I would like to customize the high-level stitcher class (for example, to add an assumption that the images are ordered). 我想自定义高级订书机类(例如,添加一个图像已排序的假设)。 Nevertheless, the python class is only a binding and thus require me to re-implement the entire class in order to be able to customize it. 尽管如此,python类只是一个绑定,因此需要我重新实现整个类才能对其进行自定义。

Is there a Python implementation of the high-level stitcher class available? 是否有可用的高级拼接器类的Python实现?

You can modify the stitching pipeline using the methods provided by the Stitcher class: https://docs.opencv.org/4.1.0/d2/d8d/classcv_1_1Stitcher.html 您可以使用Stitcher类提供的方法修改拼接管道: https : //docs.opencv.org/4.1.0/d2/d8d/classcv_1_1Stitcher.html

You also might be interested in taking a look at https://github.com/opencv/opencv/blob/master/samples/python/stitching_detailed.py 您可能也有兴趣看看https://github.com/opencv/opencv/blob/master/samples/python/stitching_detailed.py

If you modify the detailed example you can do things like speed up computation given you know the order of images by adding this: 如果您修改了详细的示例,则可以通过添加以下内容来执行诸如加快计算速度之类的操作:

match_mask = np.zeros((len(features), len(features)), np.uint8)
for i in range(len(features) - 1):
    match_mask[i, i + 1] = 1

(source: https://software.intel.com/en-us/articles/fast-panorama-stitching ) (来源: https : //software.intel.com/zh-cn/articles/fast-panorama-stitching

and then replacing this line in stitching_detailed.py p=matcher.apply2(features) with this p = matcher.apply2(features, match_mask) 然后将其替换p=matcher.apply2(features)该行,并将其替换为p = matcher.apply2(features, match_mask)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM