将照片拼接在一起 [英] Stitching Photos together
问题描述
所以对于我正在进行的这个项目,我有 2 张照片.这两张照片需要拼接在一起,一张在上面,一张在下面,然后你就可以看到整个画面了.关于我应该使用什么模块来做到这一点的任何想法?
So for this project I'm working on, I have 2 photos. These two photos need to be stitched together, one on the top and one on the bottom, and then you will be able to see the whole picture. Any ideas on what module I should use to do this?
推荐答案
python 成像库(更新链接)会在早餐时完成这项任务.
The python imaging library (updated link) will eat that task for breakfast.
请参阅教程 特别是剪切、粘贴和合并图像";部分相关帮助.
See the tutorial in particular the "Cutting, Pasting and Merging Images" section for some relevant help.
对于粗略的轮廓,使用 Image.open
加载两个图像,通过使用 size
属性和一些添加找出输出图像的大小,创建输出图像与Image.new
,然后使用paste
方法将两个原始图像粘贴进去.
For rough outline, load both images with Image.open
, find out how big the output image will be by using the size
attribute and some addition, create the output image with Image.new
and then use the paste
method to past the two original images in.
这篇关于将照片拼接在一起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!