如何创建极大的向量
我想将图像每个像素的强度存储在 *n 矩阵中。我目前将其存储在向量中。但对于非常大的维度,程序会因为内存不足而崩溃。我该如何解决这个问题?
I want to store the intensity of each pixel of an image in a n*n matrix. I am currently storing it in a vector. But for extremely large dimensions the program crashes as it runs out of memory. How do i solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的 RAM 太小而无法容纳所有信息,您将需要使用其他存储方式。也许交换到您的硬盘。强度是什么样的信息?浮点数?您的大图像有多少像素?我认为你的存储类只会产生太多的开销。您使用哪种语言?你能提供一些代码片段吗?
If your RAM is too small to hold all the information, you will need to use other means of storage. Maybe swapping to your harddisk. What kind of information is the intensity? A floating number? How many Pixels do your large images have? I think that your storage class simply creates too much overhead. Which language are you using? Can you supply some code snippets?