python - 有效地在较大图像中找到图像的最佳拟合位置
问题描述
我的图像非常接近于另一个图像的裁剪版本。(同一位置的不同平均图像,意味着去强调移动物体),我想弄清楚在哪里裁剪更大的图像,以便图像适合。
我尝试在图像之间进行 2d 相关性以找到具有最高相关性的点并使用 scipy.signal,correlate2d 找出位置,但它的效率非常低。
使用 opencv 加载图像并转换为 numpy 数组。
任何人都可以提出一种有效的方法来在 python 中执行此操作吗?
解决方案
Template matching from Opencv library suits your need
Here in the link you can find the documentation and a very good example
推荐阅读
- pandas - Pandas Pivot-Table Containing List
- amazon-web-services - 从 aws ssm get-parameter 命令中仅检索一个参数值?
- logging - 如何使用 Serilog 将一个请求中的所有日志消息记录到单个条目
- react-redux - Redux Form on Submit 为 SubmissionError 抛出 Uncaught (in promise)
- ruby-on-rails - 如何测试 ActionMailer 对象中的实例变量?
- python - TypeError:对于我正在尝试解决的小范围问题,“NoneType”对象不可迭代
- git - git push 错误,因为它有一个工作副本
- python - 命令引发异常:TypeError:send() 采用 1 到 2 个位置参数,但给出了 3 个
- python - 我可以在 python 中通过其名称字符串获取 var 吗?
- kubernetes - 如何更快地进入 Kubernetes 托管容器?