I was working with the OpenCV tutorial code for camera app on android. I encountered the same error, and after looking at the answers I indeed missed one permission.
Although the app doesn't save any data externally, without this permission, the access denied error occurs.
Hope it helps.