2

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.

4

1 回答 1

2

我找到了解决这个问题的方法。我从源代码编译了 OpenCV,当我最初构建和安装它时,它缺少某些 JPEG 相关库。为了解决它,我重新配置了源目录(通过运行 cmake)并手动安装了它没有找到的库。这些对于 OpenCV 来说并不重要,因此它不会阻止安装。之后我重新编译并重新安装了 OpenCV。

于 2014-11-06T17:32:13.727 回答