1. A computer implemented method of identifying and selecting end-diastolic and end-systolic X-ray image frames from a sequence of X-ray ventricular angiogram image frames, the method comprising: modeling said angiogram image frames by a dynamic graphical model, said dynamic graphical model formulating areas of ventricular region in the angiogram image frames as a sequence of foreground states, formulating backgrounds in the angiogram image frames as a sequence of background states, wherein the changes of the foreground states and the background states from one image frame to a subsequent image frame is formulated as a Markov chain and the foreground states and the background states generating corresponding observations that are overlapped in each angiogram image frames; estimating a posterior probability density of the foreground state of each angiogram image frame based on both foreground and background observations using Bayesian probability density propagation and adaptive background modeling; calculating an expectation value of said posterior probability density of the foreground state of each angiogram image frame, said expectation value representing an estimation of the area of the ventricular region represented in each angiogram image frame; and generating a variation curve of the expectation values, said variation curve containing a plurality of peaks and valleys whereby said peaks correspond to end-diastolic angiogram image frames and said valleys correspond to end-systolic angiogram image frames.