1 | initial version |
As far as I remember, >> operator creates matrix that points to place where last grabbed image is stored. It doesn't perform real copy of data of image. And next grabbed image will be stored in the same place, since it is not storing all the previous frames unless you did that manually. So by calling 'cap >> frame1;' you changed contents of frame as well. Now both frame and frame1 points to the same place. So course they will be the same. You should use functions like clone() or copyTo() if you want to store the your frame somewhere else.