无法使用opencv加载大图像

编程入门 行业动态 更新时间:2024-10-28 16:20:16
本文介绍了无法使用opencv加载大图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试使用大小为100.000 * 15.000像素且文件大小为4.305 kb的opencv加载图像。如果我使用以下代码加载此图像:

I try to load an image with opencv that has the size 100.000 * 15.000 pixels and a file size of 4.305 kb. If i load this image with the following code:

cv::Mat reallyBigImage = cv::imread("reallyBigImage.png");

我收到以下错误:

我有一台32 gb ram的电脑,并以64位编译该程序。这对于这种尺寸的图像应该足够了。是否可以将这样一个大图像加载到opencv?

I have a pc with 32 gb ram and compile this program in 64 bit. This should be enough for an image of this size. Is it possible to load such an large image as whole to opencv?

这是我的程序在汇编程序中断的地方。 箭头表示具体位置。这个片段来自memcpy.asm。

Here is where my program breaks in assembler. The arrow indicates the specific location. This snippet is from the memcpy.asm.

CopyUp: cmp r8, 128 jbe XmmCopySmall bt __favor, __FAVOR_ENFSTRG ; check for ENFSTRG (enhanced fast strings) jnc XmmCopyUp ; If Enhanced Fast String not available, use XMM ; use Enhanced Fast Strings ; but first align the destination dst to 16 byte alignment mov rax, r11 ; return original destination pointer mov r11, rdi ; save rdi in r11 mov rdi, rcx ; move destination pointer to rdi mov rcx, r8 ; move length to rcx mov r8, rsi ; save rsi in r8 mov rsi, r10 ; move source pointer to rsi -->rep movsb ; copy source to destination buffer mov rsi, r8 ; restore rsi mov rdi, r11 ; restore rdi ret

推荐答案

运行一些本地测试,这可以用OpenCV 3.1复制,但不能用3.2或3.3复制。这表明这是一个错误(以及你首先获得访问冲突的事实)。

Running some local tests, this can be reproduced with OpenCV 3.1, but not with 3.2 or 3.3. That suggests it was a bug (along with the fact that you're getting an access violation in the first place).

特别是问题#6317 。

这是在OpenCV发布之前修复的3.2,这将符合上述观察结果。因此,最好的选择是升级您的OpenCV副本。

This was fixed prior to release of OpenCV 3.2, which would match the above observations. Hence, the best option would be to upgrade your copy of OpenCV.

更多推荐

无法使用opencv加载大图像

本文发布于:2023-05-26 09:51:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/252290.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   加载   opencv

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!