First time here? Check out the FAQ!
answered 2016-03-16 13:23:34 -0600
you have defined "frame" as a Mat matrix but you are not storing anything try to use
cap >> frame;
so that frame is displayed as the capturing device and as mention don't initialise the camera in the loop