本文介绍了重采样大图像以进行显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



该帖子较少寻求解决方案",而更多的是寻求意见".

我有2个大图像文件.每个像素存储为短整数或浮点值(取决于源).图片非常大-大约10000px x 7000px.

我想在一个设置的窗口中显示它们-每个窗口500像素乘500像素(用户可调整大小).一个窗口将包含整个图像(重新采样),另一个窗口将包含1:1缩放视图.通过单击调整大小后的图像视图,可以选择要放大的区域. (标有红色方块)

那就是我打算做的.但是我需要确定如何实际实施的帮助.

1.我的一个想法是在开始时对整个文件重新采样(可能需要5到10秒?)并另存为位图或二进制文件.然后加载它.
第二个想法是动态加载补丁.因此,起初我会做类似最近邻居的事情,然后在小块上进行三次三次重采样.这将减少观看图像的等待时间,但可能要复杂得多. (有点像Google Earth一样吗?)
您认为哪一个更好?开始时要重新采样,但以后要有统一的用户体验.或以某种方式逐块重新采样.

2.我无法决定如何实现绘图图面.在文档上使用GDI逐像素绘制. (我使用MFC)或另存为位图并加载到图片框.还是一些openGL方法? (我在这里很迷路,但是我愿意学习-链接会被申请)

3.我可以在多个位置访问一个文件吗?如果我可以让一个线程对文件的一半进行重采样,而另一个线程对文件的下半部分进行重采样,那将非常快.但我不确定是否有可能. (也许我可以事先复制文件并查找?)

任何帮助和意见,将不胜枚举.我只是想制定一些工作框架/计划.
链接/教程.我是MFC的新手.

Hi,

This post is less "solution seeking" and more "opinion seeking".

I have 2 large image files. Each pixel is stored either as a short integer or a float value (depending on source). The images are huge - about 10000px by 7000px.

I want to display them in a set windows - of say 500px by 500px each (user resizable). One window will contain the whole image (resampled) and another will contain a 1:1 zoomed view. The area to zoom into will be chosen by clicking in the resized image view. (Marked with a red square)

That is what I intend to do. But I need help deciding how to actually implement it.

1. One idea I have is to resample the whole file at start (may take 5-10 secs?)and save as a bitmap or a binary file. Then load it.
The second idea is to load in patches dynamically. So initially I do something like a nearest neighbour approximation, and then do bicubic resampling on small patches. THis will reduce the wait time to see the image but may be much more complex. (Bit like what google earth does?)
Which one do you think is better? Resample at start, but have a uniform user experience later. Or resample block by block in some way.

2. I cant decide how to implement the drawing surface. Plot pixel by pixel using GDI on a document. (Im using MFC) Or save as a bitmap and load to picturebox. Or some openGL method? (Im very lost here, but im willing to learn - links will be appriciated)

3. Can I access one file at multiple points? If I could have one thread resampling half of the file, and another doing the next half, it would be really quick. But im not sure if its possible at all. (May be I can copy the file beforehand and seek?)

Any help and opinion on this would be appriciated. Im just trying to lay down some a framework / plan of work to.
Links / Tutorials appriciated. Im new to MFC.

推荐答案



这篇关于重采样大图像以进行显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 23:21