图像处理技术 - 直接操作目标图像还是虚拟化?
我需要将地理坐标系中引用的一系列 ariel 图像重新投影到 UTM 投影中。 我读过,使用 getPixel 和 setPixel 可能会很慢 - 应该设置一系列二维数组用于中间访问,然后在完成后将值刷新到目标图像。
这种图像处理通常是由专业人员完成的吗?
i need to re-project a series of ariel images that have been referenced in a geographical coordinate system into a UTM projection. I had read that using getPixel and setPixel might be slow - should set up a series of 2 dimensional arrays for intermediate access and then flush the values to the destination image when I am done.
Is this normally this sort of image processing is done by the professionals?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
大多数图像处理都是特征检测、场景分割、故障查找、分类和跟踪......
您可能想看一下这本书:《
其中描述了许多图像转换的许多快速有效的方法。 这两本书在我处理图像时对我有帮助:)
如果我理解你的问题...如果你正在重新对齐或组装许多图像,并且你没有方向和位置,你可以使用这些算法来重新对齐或组装许多图像。 -边缘和共同特征的对齐。 如果您按位置拼接,那么这些算法将有助于重新采样/调整图像大小,以实现更高效的组装。 还有一些用于此类事物的开源库。 (我想到了 OpenCV)
编辑:如果我根据位置转换将大图像重新投影到新的投影中(并且它是动态的,而不是静态的),我会考虑构建一个按需应用程序将在给定所需分辨率和所需位置的情况下重构图像。 然后,应用程序可以提取相关邻域图像的最接近的分辨率,并提供所需分辨率的结果。
没有更多背景,我希望这会有所帮助!
编辑2:
以下答案的评论:
取决于图像。 如果它们的大小是固定的,那么数组可能会更好。 如果它们有所不同,那么最好实现一个系统,该系统使用相对采样/平均来提供 get/setpixel 来匹配不同分辨率的图像?
我不知道您正在使用的图像的来龙去脉,以及您正在做什么,但通常抽象“像素”是什么而不是访问数组中的值是有用的。 这样就可以在后端实现转换、采样、旋转、校正算法。 类似于 GetVPixel() 或 SetVPixel()。 当处理多个不同分辨率/格式的图像时,这可能更有用。 就像
以 OOP/C# 方式显然一样。 img1 和 img2 的大小、分辨率、地理位置、对齐方式或其他任何内容都可以不同,前提是您的后端能够理解这两者。
Most image processing is feature detection, segmentation of a scene, fault finding, classification and tracking ....
You might want to take a peek at the book:
Which describes many fast and effective means of many image transformations. These two books helped me when I was processing images :)
If I understand your question ... If you are re-aligning or assembling many images, and you don't have orientation as well as position, you can use these algorithms for re-alignment of edges and common features. If you are stitching by position then these algorithms will help in re-sampling/resizing your images for more efficient assembly. There are also some open source libraries for these kinds of things. (OpenCV comes to mind)
edit: If I were re-projecting large images into new projections based on position conversion (and it were dynamic, not static) I would look into building an on-demand application that will refactor images given required resolution and desired position. The application can then pull the nearest resolution of the relative neighbourhood images and provide a result at the desired resolution.
Without more background, I hope this helps!
edit 2:
Comment from answer below:
Depends on the images. If they are fixed size then an array might be good. If they vary then it might be better to implement a system that provides get/setpixel using relative sampling/averaging to match up images of differing res?
I don't know the ins and outs of the images you are working with, and what you are doing, but often abstracting what a 'pixel' is rather than accessing values in an array is useful. This way you can implement conversion, sampling, rotating, correcting algorithms on the backend. Like GetVPixel() or SetVPixel(). This may be more useful when working with multiple, differing res/format images. Like
Obviously in an OOP/C# manner. img1 and img2 can be different in size, res, geographics, alignment or anything else providing your backend understands both.
如果您不介意使用不安全的代码,您可以将 Bitmap 的 BitmapData 包装在一个对象中,该对象允许您有效地获取和设置像素。 下面的代码大部分取自高斯模糊滤镜,我自己做了一些修改。 如果您的位图格式不同,这不是最灵活的代码,但我希望它说明了如何更有效地操作位图。
If you don't mind using unsafe code, you can wrap the Bitmap's BitmapData in an object that allows you to efficiently get and set pixels. The below code is mostly taken from a gaussian blur filter, with a couple of modifications of my own. It's not the most flexible code if your bitmap formats differ but I hope it illustrates how you can manipulate bitmaps more efficiently.
FreeImage 库速度相当快,并且提供了可能有用的剪切和粘贴功能。 该发行版附带一个 C# 包装器。
The FreeImage library is pretty fast and offers a Cut and Paste that might be useful. The distribution comes with a C# wrapper.
AFAIK GetPixel/SetPixel 的开销是对其的调用,访问数组时没有调用,因此开销较小。
您应该从 GetPixel/SetPixel 开始,您可以稍后覆盖这些调用以使用直接数据访问。
AFAIK the overhead of GetPixel/SetPixel is the call to it, when accessing an array there is no call hence less overhead.
You should start with GetPixel/SetPixel, you can alway override those calls later to use direct data access.