是否有软件可以将大量小型数字图像拼接在一起而无需旋转或拉伸它们? [英] Is there software to stitch together a high number of small digital images without rotating or stretching them?

查看:204
本文介绍了是否有软件可以将大量小型数字图像拼接在一起而无需旋转或拉伸它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常多的小图像(360x192),按顺序拍摄,作为DOS 2D电脑游戏的截图。它们有很好的重叠,我想将它们拼接成一个大的复合材料。由于它们的本质,每个后续图像将在下一个或前一个图像上完美地匹配像素。因此,不需要旋转,拉伸或扭曲或者需要。

I have a very high number of small images (360x192), taken in sequence as screenshots from a DOS 2D computer game. They have decent overlap and i'd like to stitch them together into one big composite. Due to their very nature each subsequent image will fit pixel-perfect over the next or previous one. As such no rotation, stretching or distortion is required OR desired.

有很多软件可以将照片全景图拼接在一起。但遗憾的是,即使他们被明确指示不这样做,所有这些都会产生一些失真。

There is a lot of software out there to stitch together photo panoramas. But sadly all of them apply some distortion, even when they're explicitly instructed not to do so.

是否有软件可以尝试像素完美拼接?

Is there software that will try to do pixel-perfect stitching?

推荐答案

Mathematica 8具有以下功能:

Mathematica 8 features functions to do that:

ImageAlign[img1, img2, "Transformation" -> "Translation"] 
FindGeometricTransform[img1, img2, "Transformation" -> "Translation"] 

通过将转换选项设置为翻译,您可以保证结果变换不会有你提到的任何扭曲。

By setting the option "Transformation" to "Translation" you are guaranteed that the result transformation will not have any of the "distortions" you are mentioning.

文档中的更多例子:

http://reference.wolfram.com/mathematica/ref/ImageAlign.html

http:// reference.wolfram.com/mathematica/ref/FindGeometricTransform.html

我知道可以将Mathematica链接到perl,但我还没有尝试过。

I know one can link Mathematica to perl, but I have not tried it yet.

编辑:使用您发送的链接,我想出了以下内容。唯一的问题是你需要事先指定输出的大小--- NB我只试过前10张图片。

Using the link you sent, I came up with the following. The only problem is that you need to specify in advance the size of the output---NB I tried only the first 10 images.

directory = "~/Downloads/done/";
files = FileNames["*.bmp", directory];

canvas = ImagePad[Import[files[[1]]], {{100, 100}, {500, 100}}, Transparent];
Do[
    i = Import[f];
    fun = FindGeometricTransform[canvas, i, "Transformation" -> "Translation"];
    If[Head@fun === FindGeometricTransform,
        Continue[]
    ];
    canvas = ImageCompose[
               canvas,
               ImagePerspectiveTransformation[i, fun[[2]], DataRange -> Full, PlotRange -> Transpose[{{0, 0}, ImageDimensions[canvas]}], Padding -> Transparent], 
               {1, 1, -1}],
 {f, files[[;; 10]]}]

这篇关于是否有软件可以将大量小型数字图像拼接在一起而无需旋转或拉伸它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆