MMAL library and raspivid/raspistill source code are found in Userland folder (@GitHub, here). First of all, we need to compile the whole package before doing anything else with OpenCV.
- get source code (zip file) here : https://github.com/raspberrypi/userland
- unzip the file and copy the directory under /opt/vc
- go to opt/vc and type : sed -i ‘s/if (DEFINED CMAKE_TOOLCHAIN_FILE)/if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)/g’ makefiles/cmake/arm-linux.cmake
- create a build directory and compile (it takes a while)
sudo mkdir build
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
Binary should be under /opt/vc/bin
Go to /opt/vc/bin and test one file typing : ./raspistill -t 3000
At this stage, you should be able to modify this software to include OpenCV calls. Congratulation ! Now, all nexts steps are piece of cakes….