我正在 OSX 10.7.5 上运行 OpenCV (2.4.3) 的 brew 安装。我已经尝试过 OpenEXR (1.7.0) 的 brew install 和下载它们的源代码并直接编译 1.7.1,因为我读到它的界面可能已经发生了一些变化。两个版本的 OpenEXR 都可以让我在预览中打开 EXR 文件。每次新安装 OpenEXR 后,我都会返回,卸载 OpenCV 并重新安装。OpenCV 正在检测正确的 OpenEXR:
-- Media I/O:
-- ZLib: /usr/lib/libz.dylib (ver 1.2.5)
-- JPEG: /usr/local/lib/libjpeg.dylib (ver 80)
-- PNG: /usr/X11/lib/libpng.dylib (ver 1.5.4)
-- TIFF: /usr/local/lib/libtiff.dylib (ver 42 - 4.0.3)
-- JPEG 2000: /usr/local/lib/libjasper.dylib (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
当我尝试在 python 中通过 cv2 读取或写入 EXR 时,我得到
terminate called throwing an exceptionAbort trap:6
这是完整的崩溃报告:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
abort() called
objc[52394]: garbage collection is OFF
terminate called throwing an exception
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8e43a82a __kill + 10
1 libsystem_c.dylib 0x00007fff8e012a9c abort + 177
2 libc++abi.dylib 0x00007fff8d2607bc abort_message + 214
3 libc++abi.dylib 0x00007fff8d25dfcf default_terminate() + 28
4 libobjc.A.dylib 0x00007fff944501cd _objc_terminate + 114
5 libc++abi.dylib 0x00007fff8d25e001 safe_handler_caller(void (*)()) + 11
6 libc++abi.dylib 0x00007fff8d25e05c std::terminate() + 16
7 libc++abi.dylib 0x00007fff8d25f152 __cxa_throw + 114
8 libopencv_highgui.2.4.dylib 0x000000010dc49d44 Iex::throwErrnoExc(std::string const&, int) + 3492
9 libopencv_highgui.2.4.dylib 0x000000010dc4a8fc Iex::throwErrnoExc(std::string const&) + 24
10 libopencv_highgui.2.4.dylib 0x000000010dc4c5e7 IlmThread::Semaphore::Semaphore(unsigned int) + 67
11 libopencv_highgui.2.4.dylib 0x000000010dc4b969 IlmThread::ThreadPool::Data::Data() + 27
12 libopencv_highgui.2.4.dylib 0x000000010dc4be74 IlmThread::ThreadPool::ThreadPool(unsigned int) + 46
13 libopencv_highgui.2.4.dylib 0x000000010dc4c260 IlmThread::ThreadPool::globalThreadPool() + 46
14 libopencv_highgui.2.4.dylib 0x000000010dc696aa Imf::globalThreadCount() + 9
15 libopencv_highgui.2.4.dylib 0x000000010dc3e38b cv::ExrDecoder::readHeader() + 35
16 libopencv_highgui.2.4.dylib 0x000000010dc2f54a _ZN2cvL7imread_ERKSsiiPNS_3MatE + 249
17 libopencv_highgui.2.4.dylib 0x000000010dc2f3d4 cv::imread(std::string const&, int) + 132
18 cv2.so 0x000000010d4d28f4 _ZL15pyopencv_imreadP7_objectS0_S0_ + 332
19 org.python.python 0x000000010d19ed77 PyEval_EvalFrameEx + 13861
20 org.python.python 0x000000010d1a1cd8 PyEval_EvalCodeEx + 1996
21 org.python.python 0x000000010d1a1d4d PyEval_EvalCode + 54
22 org.python.python 0x000000010d1b908f 0x10d117000 + 663695
23 org.python.python 0x000000010d1ba671 PyRun_InteractiveOneFlags + 517
24 org.python.python 0x000000010d1ba79a PyRun_InteractiveLoopFlags + 214
25 org.python.python 0x000000010d1ba7fc PyRun_AnyFileExFlags + 63
26 org.python.python 0x000000010d1ca2af Py_Main + 2715
27 org.python.python 0x000000010d10fe88 0x10d10f000 + 3720
具体来说,这些错误是由于:
import cv2
cv2.imread("image.exr")
有什么建议么?
编辑:我还尝试从 OpenCV 网站重新编译 2.4.3 的源代码,并且遇到了完全相同的问题。