I never use OpenCV in C++, but I think this is the same. I am using OpenCV4Android and I need to do something when a frame comes in, it will acturally slow the fps if you put your procedure in the onCameraFrame() function(I guess its like the read() function in C++) because only when the frame return, the next frame is coming in.
My solution is use another thread to process the frame. what you can do in your read() function is setting the flag to indicate the frame is in videoCapture object or not, then use the process thread to check the flag, if there is, process it. The fps will be better.