![]() |
RIFeatures
1.0
A C++ library for calculating rotation invariant features from 2D images using OpenCV.
|
A small C++ library for calculating rotation invariant image features.
The purpose of this library is to calculate rotation invariant features from 2D images. These are a set of features that describe circular image patches in an image in a way that is invariant to the orientation of the patch. They can therefore be used to detect objects in any orientation in a straightforward way.
The emphasis is on providing a highly efficient implementation that:
A detailed description of how the feature extraction method works, an evalution, and citations of relevant scientific literature can be found in my DPhil (PhD) thesis. You can find out more about how I am using the library on my website.
Disclaimer This is research-quality code I have provided to enable others to understand, reproduce and develop my research. It is not intended to be production quality code. It expects to be used in a certain way and there are many ways to break it by not using it in this way resulting in runtime crashes or unexpected results. There is very minimal error checking to detect these cases. Follow the examples and documentation closely though and it should be easy to use it correctly.
The library consists of a shared object library (librifeatures.so
or .dll
on Windows) and a set of headers.
In order to use the library you will need to compile all the source files in the src
directory to create the object file and install it somewhere on the dynamic linker path on your system. You will also need to copy the header files (in the include
directory) to somewhere your compiler will find them, or point your compiler at them each time.
A makefile is provided to automate these tasks on most GNU/Linux operating systems using the g++
compiler. To use this, navigate to the build
directory and execute the following commands:
You can also compile and install a debug version of the library (librifeaturesd.so
) with:
You can uninstall both the release and debug versions with:
For other environments you will need to work out how to do these steps yourself.
Once installed, to use the library in your C++ code, you just need to include the following header file in your source files:
Then when compiling your code, make sure to link against OpenCV and the librifeatures.so
shared object, as well as using c++11 or later and the OpenMP extensions. E.g. to compile a source file called my_program.cpp
to produce an executable called my_program
, use something like the following:
If you have decided not to install the library on your system as above, you just need to add the include
directory to the list of directories your compiler looks at for headers, and add the compiled shared object file to the linker dependencies.
The repository includes an example file (example/rotinv_test.cpp
) with plenty of comments that demonstrates how to use the basic functionality of the library.
You can compile it (once the library has been installed, as above) by running the following from the build
directory:
You can then run it with on a video file (path/to/some/video/file.avi
):
The full documentation can be found here or generated from the source using Doxygen. To do this, install the Doxygen tool (available in most GNU/Linux repositories) and from the doc
directory run.
This will generate an html version of the documentation in the html
subdirectory, which you can view by opening index.html
in your browser.
This library was used in the following publications:
If you use this library in your research, please consider citing these papers. Other relevant publications include:
Finally, much of this work is based heavily on the following paper, with which I have no association:
Written by Christopher Bridge at the University of Oxford's Institute of Biomedical Engineering.
The repository also includes some code written by J-P Moreau for calculation of the struve function (the two functions in struve.cpp
) that was put up with no licensing information here. For convenience I have included a slightly modified versions of these files. If you feel that I have misappropriated your code, please get in touch.
This library is available under the GNU General Public License (GPL v3). For more information, see the licence file.