使用IDL计算图像堆栈的中值(Computing a median of stack of images using IDL)

我试图以TIF格式计算一堆图像的中位数用于我的研究。 从另一个来源,我发现了一种方法来计算GDF格式的图像堆栈,使用

IDL> buf=read_gdf('demo.gdf') IDL> help, buf BUF FLOAT = Array[640, 480, 100] IDL>b=median(buf,/double,dimension=3)

但是,我很难将我的TIF图像转换为GDF,但仍需要以某种方式规范化我的图像。 有关如何这样做的任何建议? 先感谢您。 任何帮助将非常感谢!

I am trying to compute a median of a stack of images in TIF format for my research. From another source I found out a way to compute this from stack of images present in a GDF format, using

IDL> buf=read_gdf('demo.gdf') IDL> help, buf BUF FLOAT = Array[640, 480, 100] IDL>b=median(buf,/double,dimension=3)

However, I am having difficulty converting my TIF images into GDF, but still need to normalize my images somehow. Any suggestions on how to do so? Thank you in advance. Any help will be highly appreciated!

最满意答案

我会使用ImageMagick。 它是免费的,可以在大多数Unix / Linux中从命令行获得,并且还具有C / C ++,Perl,PHP绑定。 它在这里可用。

如果当前目录中有许多JPEG文件,您可以在终端中使用这样的简单命令获取中值:

convert *.jpg -evaluate-sequence median output.jpg

结果将在output.jpg 。 它也适用于TIFF / PNG / GIF文件 - 作为输出或输入。

convert *.tif -evaluate-sequence median output.png

我假设你的图像对齐且尺寸相同......

I would use ImageMagick. It is free and available from the command line in most Unixes/Linuxes and has C/C++, Perl, PHP bindings too. It is available here.

If you have a number of JPEG files in your current directory, you can get the median with a simple command like this in your Terminal:

convert *.jpg -evaluate-sequence median output.jpg

and the result will be in output.jpg. It will work just as well for TIFF/PNG/GIF files too - as outputs or inputs.

convert *.tif -evaluate-sequence median output.png

I am assuming your images are aligned and simliarly sized...

更多推荐