I am trying to check whether the previous has current image or not after the loop. I do not find the current image stored in previous. I took an example code which acquires video from discussion form and would like to get a current frame and previous frame when using a while loop. Could anyone let me know, the mistake in the code. I am attaching the code.