I own a OP5 faced the same issue while opening the camera. The screen is either blacked-out or the screen has a black filter kind of effect and the display shows black filter display while clicking pictures. It's the same when we choose the front camera. Using the same stock app and no other apps are installed for camera. Restarting the phone seems to solve the problem and 3 of my friends who own a OnePlus 5 faced the exact same issue while opening the camera?
I didn't find the right solution from the Internet.