/* Assuming this is a while loop -> e.g. video stream where img is obtained from say web camera.*/
cvShowImage("Window",img);
/* A small interval of 10 milliseconds. This may be necessary to display the image correctly */
cvWaitKey(10);
/* to wait until user feeds keyboard input replace with cvWaitKey(0); */