Welcome to cocolib release 6

DOCUMENTATION ON THE WEB PAGE IS IN THE PROCESS OF BEING UPDATED FOR RELEASE 6. BUILD INSTRUCTIONS SHOULD BE COMPLETE AND WORKING, BUT MIGHT STILL BE PARTIALLY INCONSISTENT UNTIL EVERYTHING IS FULLY TESTED. DOCUMENTATION OF THE EXAMPLES IS IN PREPARATION.

Release 6 has been officially added to the SourceForge download area on 19.8.2014, and is the newest supported release. Please see here for a list of new features.

Main library

cocolib is a C++ library for variational image analysis and continuous global optimization, focusing on the minimization of functionals of the type

E(u) = J(u) + F(u)

where u is an image (i.e. vector-valued function on a grid), J is a convex regularizer, and F a (usually) convex data term.

A number of generic and more specialized solvers are implemented, focusing on linear inverse problems and multi-label segmentation with various models for regularization and data terms. See the feature list for details.

CUDA and experimental OpenCL support

The project was initially started over five years ago as a CUDA library, so all algorithms implemented up until release 5 required CUDA support and are GPU accelerated. By now, the library has grown wild a bit, while certain flaws in the original design became more and more obvious. Therefore, cocolib is undergoing a major restructuring and consolidation phase.

The library is currently being rebuild around a new core design called cocolib++, with an abstract layer around all multi-core computations previously done only in CUDA. This allows implementing these with alternate code paths, and cocolib++ now proudly supports an initial set of algorithms in OpenCL.

At the moment, the old legacy code is still in place, but the plan for the future is to slowly move the most important subset of algorithms over to the new design, and then gradually phase out most of the very specialized and experimental legacy code which is less useful in practice. It will always remain available via release 6.

Matlab interface

The new cocolib++ core was designed with an elegant interface to Matlab in mind, and Release 6 for the first time makes it possible to use a subset of cocolib++ algorithms directly in the Matlab interpreter. Currently, linear inverse problems are supported with all variants of total variation regularizers implemented in cocolib++ (VTV_x and TGV_2). Furthermore, the interface allows rapid prototyping of new methods: it is possible to implement a data term directly in Matlab and pass it to the optimization algorithms in cocolib with arbitrary regularization.

Increasing the set of methods supported in Matlab is top priority and will be done in parallel to moving code to the new library design.

Light field analysis

Since release 5, cocolib also contains a growing toolkit for light field analysis based on variational methods, which implements many methods from our research papers and has ready-to-use scripts for benchmarking on the HCI light field data base. For further information, see the light field suite documentation. Currently, no part of the light field analysis suite has been ported to cocolib++, but it is still available when using the CUDA code path.

Requirements and support

All algorithms are implemented in C++ using CUDA, with a subset also working using an alternate OpenCL build configuration. They have been tested on Ubuntu 13.04 and above, Fedora Core 19 and Mac OS X, but should compile and run on many other Debian flavors as well. The code is provided as a service to the image processing community and "as is", without any support beyond the documentation presented here. If you run into a problem, please ask in the forum or via e-Mail for help. If we find the time, we will try to be of assistance.

You will need a CUDA capable graphics card in your system, which supports at least compute capability 1.3. See the installation instructions for pre-requisite packages which need to be installed. The OpenCL code path requires only a working OpenCL 1.1 development and code execution envionment, but gives only a relatively small subset of the complete library.

Disclaimer

The library is research code. In particular, it has not been tested except for a certain small range of use cases, and might fail spectacularly if provided with unexpected parameters (including completely crashing your system). Do not use in production environments unless you add lots of safeguards, in which case I'm happy if you can contribute back to the repository (contact me for access).