使用 OpenCV 和 Python 将拼图图像拼接在一起
我正在尝试使用 OpenCV 和 Python 将数百张拼图图像拼接成一张大的完整图像。所有图像均已数字化并采用 PNG 格式。这些碎片最初来自扫描并提取成单独的碎片,因此它们具有透明的背景并且每一个都是单独的碎片。使用 OpenCV 比较它们并找到匹配项的过程是怎样的?
计划是图像和拼图块总是不同的,这个 python 程序将扫描所有布置的拼图块,裁剪出拼图块(现在就是这样做的),然后重新构建拼图。
I am trying to use OpenCV and Python to stitch together several hundred puzzle piece images into one large, complete image. All of the images are digitized and are in a PNG format. The pieces were originally from a scan and extracted into individual pieces, so they have transparent backgrounds and are each a single piece. What is the process of comparing them and finding their matches using OpenCV?
The plan is that the images and puzzle pieces will always be different and this python program will take a scan of all the pieces laid out, crop out the pieces (which it does now), and build the puzzle back.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这是您尝试做的一个有趣的小项目,您可以比较图像直方图或使用SIFT/SURF。我认为Python API中没有SIFT、SURF的实现。如果您能找到兼容的等效项,您就可以做到。
比较图像很大程度上取决于您拥有的数据集。有些技术比其他技术更有效。
If this is a small fun project that you are trying to do, you can compare image histograms or use SIFT/SURF. I don't think there is implementation of SIFT, SURF in Python API. If you can find compatible equivalent, you can do it.
Comparing images are very much dependent on the data-set that you have. Some techniques work more better than the other.