I believe you are using the wrong version of open() on line 28 - adding deviceID + appId together. It's better to use the new version of .open() taking two integers as parameter.
- use per-module includes instead of "opencv.hpp" - unused function warnings - undefined macro warning