Sequential images are getting more and more popular in reconstruction of 3D images for computer-aided surgery or radio-therapy, where contour detection is needed and plays a significant role. In order to overcome the conflict of optimization with computational cost, we have recently developed a novel algorithm to track contours in an image sequence automatically. The whole procedure starts from a list of labeled seed points on/near the desired boundary in the first frame, and extracts the first contour by dynamic programming (DP). Such contour is thickened symmetrically to form a band area, which is assumed to cover the desired contour in the second frame. Meanwhile, the previous seed points are regarded as uncertainties of the second frame. Then a new method is proposed to optimize these points within the band, that is, DP is operated again between two uncertainties which are t(t > 1) points apart, and get an optimal path. Such path may depart from the true contour near the two end-points, but possesses the optimal choices for the interval uncertainties. After all the uncertainties are optimized, the second optimal contour can be tracked, and again participate in the tracking of the next frame until all the contours in the sequence are outlined. Experiments shows optimal and intersection free result in sequences of cardiac vessels.