I don't have a webcam, so I cannot test your code.
It seems OK, thought. Isn't the image displayed over the video? What do you see, actually?
It seems OK, thought. Isn't the image displayed over the video? What do you see, actually?