According to: Perceptually driven 3D distance metrics with application to watermarking, Lavoué, G., Drelie Gelasca, E., Dupont, F., Baskurt, A., Ebrahimi, T., in Proceedings of SPIE Applications of Digital Image Processing XXIX, August 2006.
This is a mex package to use the MSDM 3D distortion metric.
- Author
- Guillaume Lavoué, Xavier Rolland-Nevière
Use
The source code allows to generates the project to create the mex library for the MSDM. Although it also contains the already-built MSDM library, you need the following to fully (re)-use and recompile the provided code:
- MATLAB installation: this may be obvious, but MATLAB is not cheap. You might be able to get around using Octave, but you will need to make appropriate changes to the link and includes folders in CMakeLists.txt. If you don't want to use MATLAB, you can hack and slash into the cpp code and remove the gateway function to create a traditional dll.
- Visual Studio 2010 installation (MSVC 2010). If you are using another platform than Windows, you will need to modify the CMakeLists.txt file. If you are using another version of Visual Studio, things should still work, but recall that CGAL has its own requirements.
- Eigen library (http://eigen.tuxfamily.org/index.php?title=Main_Page), which is a very useful and elegant set of headers.
- CGAL installation: download and install CGAL from https://www.cgal.org/. It is an open-source project and the licence for non-commercial use is not restrictive. Two important things when you install CGAL:
- CGAL has to be installed for the same architecture as MATLAB. If you have a x64 version of MATLAB, you will need to have a compatible x64 installation of the libraries below.
- CGAL relies on third-party libraries, such as QT and QGLViewer for visualization. In my latest tests, this part of the install crashed for my x64 architecture. As you won't need them, since you only need the core CGAL libraries, you can skip their installations and the compilation of demos and examples in CGAL.
- Boost installation, which is required to build the CGAL libraries. Download and install from http://www.boost.org/.
- Cmake installation (http://www.cmake.org/), used to set all the parameters of the MSVC solution.
- Doxygen installation (http://www.stack.nl/~dimitri/doxygen/) to generate the present documentation. If not present, this generation is bypassed.
Once everything is installed, you can use the CMake file provided to generate a MSVC 2010 solution with a main CGAL_MSDM project. Upon compilation, there is a post-build command to move the MATLAB mex library into the 'deploy' folder.
In this example, mCGAL_MSDM.m is the MATLAB wrapper function to call the simplification mex library. While mex libraries may be directly called from MATLAB, this encapsulation is useful to write help documentation accessible within MATLAB, perform some parsing operations with a high-level language, and perform checks.
MATLAB does not provide a simple way for mex function to respond to Ctrl-C interrupt, so to kill the routine, you have to kill MATLAB.