Well, as I didn't get an answer I managed to figure out the solution myself (thanks to berak for the two links). If anyone experiences issues with this answer, please feel free to write a comment. If you figure out the solution yourself, even better, write a comment with the problem and the solution!
Prerequisites
- CMake
- MinGW
- Android NDK
- Visual Studio
Building OpenCV
- Download / clone OpenCV as usual
- Start CMake configuration
- Select "MinGW Makefiles" as generator and choose "Specify toolchain file for cross-compiling"
- Choose "Path_To_OpenCV/platforms/android/android.toolchain.cmake" as Toolchain file
- In the Build group of CMake, choose the modules you need from OpenCV.
- In the With group of CMake, make sure to include Carotene in your build. At least it didn't work for me when I didn't include it.
- Generate MinGW Makefiles
- Navigate to your build folder and execute "mingw32-make", then "mingw32-make install". If any of those two fail, try generating OpenCV once more, but this time without any tests selected. This fixed it for me (search for "Test" in CMake and disable anything that comes up)
Setting up Visual Studio
- Create a new Visual Studio Project from "Visual C++/Cross Platform/Android" and choose the type of Project you want.
- Add the path "Path_to_build_folder/install/sdk/native/jni/include" to "Additional Include directories" and both the "native/3rdparty/libs/armeabi-v7a/" and "native/libs/armeabi-v7a/" to "Additional Library Directories".
- In your projects property dialog change "Enable C++ Exceptions" to "Yes (-fexceptions)" under "C/C++ - Code Generation" and "Enable Run-Time Type Information" to "Yes (-frtti)" as well. You can find it under "C/C++ - Language". Also add "-std=c++11" as Additional Option in the Command Line Section of "C/C++".
- In the Linker section of your property page, add "-lm -lz" to the command line additional options. This ensures correct linking.
- Under "Linker/Input", add all your built modules and also the 3rdparty libs as "Library Dependencies". Important: Only their names, e.g. not "libopencv_core.a", but "opencv_core". The linker will figure out the rest by itself. Now comes my favourite part: As UNIX-style linkers always scan libraries from right to left, the order in which you add the libraries matters. Now you have two options: Either play around with the order of the libraries until you figure out the correct one, or (as found by me after searching for literally hours), just go to your OpenCV build directory and search for the file "OpenCV.mk". In there the line "OPENCV_MODULES" indicates the correct order of the modules. The 3rdparty libraries have to be added after the modules in the Library Dependencies field.