Read and Write OpenEXR images in Matlab in Ununtu

Source: Internet
Author: User
Recently, Matlab does not support OpenEXR image reading and writing because of the need to process images in OpenEXR format. We found that there is a plug-in on the Internet, using this plug-in can be directly used in Matlab exrread/exrwrite OpenEXR Format Image Processing: Web site: http://www.mit.edu /~ Kimo/software/matlab exr/1) install MATLAB http: // www in Ubuntu

Recently, Matlab does not support OpenEXR image reading and writing because of the need to process images in OpenEXR format. We found that there is a plug-in on the Internet. Using this plug-in, you can use exrread/exrwrite in Matlab to process images in OpenEXR format:

Http://www.mit.edu /~ Kimo/software/matlab exr/

1) install Matlab in Ubuntu

Http://www.linuxidc.com/Linux/2012-08/68051.htm

2) install and compile IlmBase, Zlib, and OpenEXR in Ubuntu

Http://www.linuxidc.com/Linux/2012-08/68050.htm

3. decompress the file named "maid"

Sudo unzip maid-d/usr/local/

Change directory permissions: sudo chmod777-R/usr/local/MATLAB EXR

Compilation and compilation of MATLAB exr.zip

Open Matlab and change the current directory to/usr/local/Matlab EXR.

Enter the following command in the Matlab command window:

Mex exrread. cpp-lIlmImf-lHalf-I/usr/local/include/OpenEXR-L/usr/local/lib

Mex exrwrite. cpp-lIlmImf-lHalf-I/usr/local/include/OpenEXR-L/usr/local/lib

Mex exrinfo. cpp-lIlmImf-lHalf-I/usr/local/include/OpenEXR-L/usr/local/lib

Problems and Solutions:

1) Invalid MEX-file '/usr/local/matlab exr/exrread. mexglx': libIlmImf. so.6: cannot open shared object file: No such file ordirectory

Solution:

Method 1: Set LD_LIBRARY_PATH.

Enter the command vi/etc/ld. so. conf on the terminal, add/usr/local/lib, and enter the command ldconfig-v on the terminal.

Method 2: Enter the command export LD_LIBRARY_PATH =/usr/local/lib :$ {LD_LIBRARY_PATH} on the terminal}

2) Invalid MEX-file '/usr/local/matlab exr/exrread. meglx':/usr/local/MATLAB/R2012a/bin/glnx86/libstdc ++. so.6: version 'glibcxx _ 3.4.15 'not found (required by/usr/local/lib/libIlmThread. so.6)

Solution:

Cd/usr/local/MATLAB/R2012a/bin/glnx86/

Sudo mv libstdc ++. so.6 libstdc ++ _ mybackup

Sudo ln-s/usr/lib/i386-linux-gnu/libstdc ++. so.6 libstdc ++. so.6

Run strings/usr/lib/libstdc ++. so.6 | grepGLIBC to view the GLIBCXX version.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.