Ask Your Question
0

TIFF imread() fail std::bad_alloc in Ubuntu 14.04

asked 2014-08-07 15:18:02 -0500

jgmao gravatar image

Hi,

I installed a fresh Ubuntu 14.04 and use cmake and gcc 4.8 with -std=c++11 flag to build OpenCV from source. Where I select "With TIFF" and "Build TIFF" in CMake-GUI. The simple code :

#include "opencv2/opencv.hpp"
int main(void)
{  
  Mat rst = cv::imread("test.tiff",0);
  cv::namedWindow("testCV");
  imshow("testCV",rst);
  cv::waitKey(0);
  return 0;
}

compiled by:

g++ -o testcv -I/usr/local/include testcv.cpp -lopencv_core -lopencv_highgui -std=c++11

When it runs failed with info:

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

I tried compiling OpenCV 2.4.9 (Release) and 3.0.0-dev (in GitHub) source. But both of them has the same failure.I tried PNG and JPEG, they work well. What is the problem? Is this OS related problem? I used the same code in my Ubuntu 12.04, and it has no problem at all.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
-1

answered 2014-08-08 05:24:35 -0500

gfx gravatar image

the same problem with ubuntu 14.04 ... not understand ....

edit flag offensive delete link more

Comments

-1 this is not an answer, you can post a comment for this or +1 at question

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-08-08 10:40:31 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-08-07 15:18:02 -0500

Seen: 284 times

Last updated: Aug 08 '14