问题标签 [imread]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
9583 浏览

python - 让 cv2.imread 从文件对象或类似内存流的数据中读取图像(此处为非提取的 tar)

我有一个.tar包含数百张图片的文件 ( .png)。我需要通过opencv处理它们。

我想知道 - 出于效率原因 - 是否可以在不经过光盘的情况下处理它们。换句话说,我想从与 tar 文件相关的内存流中读取图片。

例如考虑

最后一行不像imread预期的文件名而不是流那样工作。

考虑到这种直接从tar流中读取的方式可以实现,例如文本(参见例如这个 SO question)。


有什么建议以正确的png编码打开流吗?

解压到 ramdisk 当然是一种选择,尽管我正在寻找更可缓存的东西。

0 投票
4 回答
23809 浏览

c++ - error: undefined reference to `cv::imread(std::string const&, int)'

I'm new to Qt and I have a project that needs to configure OpenCV in Qt , I tried to run a simple code in Qt but I got this error "undefined reference to cv::imread(std::string const&, int)" and here is my code...

and my source.pro is

I saw all the answers about but they didn't work. my Qt is 32bit and my Windows is 64bit. I think my configuration is wrong. I followed many tutorial but they weren't for OpenCV 2.4.9 so please help me ...

0 投票
2 回答
6123 浏览

c++ - 无法在opencv中读取图像

我是opencv的新手,我开始编写一个简单的代码来在gui中读取和显示图像,我在qt IDE中工作,首先我写了这段代码

但是它在控制台中显示一个白色窗口和错误,然后显示另一个窗口“不响应”消息然后停止工作,这是一个屏幕截图 http://pbrd.co/1u2A0ow 然后我写了另一个有效性代码来检查wheater与否图像已被读取

}

它显示消息,这意味着图像未读取,所以问题是我如何成功读取和加载图像注意:main.cpp文件同一文件夹中的图像 http://pbrd.co/1u2Bmj1

0 投票
4 回答
6570 浏览

android - C++ OpenCV imread 在 Android 中不起作用

我正在尝试在我的 C++ 代码中读取图像

并获得以下输出:

文件存在。但奇怪的是,如果我尝试使用根文件浏览器预览图像,它只是黑色的。我手动复制了那里的文件。

编辑:

该代码在 .png 和 .jpg 格式的 Windows 下运行良好。我只是想将 Iris Recognition 的现有 C++ 项目移植到 Android。

0 投票
3 回答
2250 浏览

opencv - 图像正常时使用 OpenCV 的 imread 失败

当我想使用 OpenCV 函数读取图像时遇到问题imread()。图像还可以,我可以在图像显示软件中显示。但是当我使用imdecode()来获取图像数据时,数据返回 NULL。我将上传图像和代码,希望有人可以帮助我

图片链接在这里:http: //img3.douban.com/view/photo/raw/public/p2198361185.jpg

PS:image_name没关系。我猜 OpenCV 无法解码这个图像。那么有什么方法可以使用 OpenCV 解码这个图像吗?比如添加新的解码库。顺便说一句,我可以使用其他图像库(例如 freeImage)来读取此图像。

0 投票
1 回答
315 浏览

c++ - OpenCV 2.4.9 reads blank image

Folks,

I am using imread to load a jpeg image into a cv::Mat data type. However, the function is unable to load the image and simply returns an empty matrix with 0 rows and 0 columns. It does not throw any exceptions or warnings. I have also verified that the image actually exists in the path specified. I have never seen this behaviour in OpenCV and am at a loss to figure out what is going on. Any help is appreciated

EDIT: After playing around, I discovered that it is able to read in PNG file formats with no problems.

0 投票
0 回答
761 浏览

matlab - imread 的 matlab url 身份验证

如何在 MATLAB 2014a 中将 IMREAD 函数与需要基本身份验证的 URL 一起使用?(不是旧的matlab)。它适用于 matlab R2013a,如此链接 http://www.mathworks.com/matlabcentral/answers/100103-can-i-perform-b ​​asic-authentication-with-urlread-in-matlab 中所述, 但上述方法没有t 适用于 matlab R2014a,因为它的函数文件中有不同的编码。需要帮助。提前致谢。

0 投票
1 回答
69 浏览

arrays - MATLAB 循环遍历某些整数并按照我指定 v2 的顺序

正常的循环是

但我想同时按照我指定的顺序通过 4 个不同数组中的某些整数执行循环。所以在第一个循环中,Matlab 会从 r1, r2, c1, c2 中获取第一个整数。然后对于第二个循环,Matlab 将从 r1、r2、c1、c2 中获取第二个整数。

另外,我希望每次循环循环时都更改 a1_raw,以便在循环结束时我应该有 8 个不同的“a1_raws”。我怎样才能在 MATLAB 中做到这一点?

0 投票
0 回答
1333 浏览

python - 在 python 中使用 mahotas 和 imread 包

我有兴趣为 python 使用 Mahotas 包,不幸的是我在安装或运行它时遇到了一些问题。当我运行时:

我得到:

所以我假设它安装正确。当尝试从文档中复制一个简单示例时,我收到以下消息:

由于我在 Mac 上工作,我按照建议运行:

这给了我:

所以对我来说,似乎我安装了 imread 就像错误消息告诉我的那样。但是我一直收到同样的信息。

有谁知道如何解决这个问题?非常感谢所有帮助!

0 投票
1 回答
2401 浏览

matlab - imread 如何缩放 12 位图像?

我有一个 12 位的 pgm-image,我用 imread 读取。结果是一个 16 位图像,其值在 0 到 2^16 - 1 的整个范围内。

Matlab 是如何缩放的?将要

恢复原来的强度?