如何处理大图像? [英] How to process large images?

查看:181
本文介绍了如何处理大图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要处理(导出子部分)大图像(33600x19200)并且我不确定如何开始。

I need to process(export subsections) of a large image(33600x19200) and I'm not sure how to start.

我试过简单地分配一个图像使用 openframeworks 但我收到此错误:

I've tried simply allocating an image using openframeworks but I got this error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

我对处理这么大的图像没有经验。我应该从哪里开始?

I'm not experienced with with processing images this large. Where should I start ?

推荐答案

std :: bad_alloc 发生,因为你没有足够的内存来容纳整个图像。

std::bad_alloc occurs, because you dont have enough memory available to hold the whole image.

为了处理这么大的事情,必须将它们分开,例如威胁图片作为一组具有明确定义的大小(例如1000x1000)的子部分/子图片并逐个处理它们。

In order to work with such big things, one has to split them, e.g threat the picture as a set of subsections / subpictures with a well defined size (e.g 1000x1000) and process them one by one.

另一个解决方案就是尽可能多地将内存投入到系统中。如果你有钱,程序应该只在一台特定的机器上运行,它肯定是一个选项,但我认为它清楚哪两种解决方案都更好;)

The other solution is simply to throw as much memory into your system as you can. If you have the money and the program should only run on one specific machine, its surely an option, but I think its clear which of the both solutions is the better one ;)

这篇关于如何处理大图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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