A new technique for computing optical flow from an extended sequence (containing more than two images) of image frames is proposed. The proposed technique explicitly utilizes the additional information present in the extended frame sequence by utilizing the smoothness of trajectory of intensity points as a constraint. Importance of trajectory smoothness of intensity points is established and its mathematical formulation is derived in terms of three components. Discontinuities in the trajectories are also modeled by a field of binary elements. Estimation of the unknown optical flow field together with the discontinuities is formulated as a Bayesian maximum a posteriori (MAP) probability estimation problem. The conditional probability of the unknown velocity and discontinuity fields, given the observed image sequence, is computed based on the trajectory and spatial smoothness model. The correspondingdistribution is shown to be a Gibbs distribution (equivalently a Markov random field). The "most probable velocity state" is then found by a stochastic relaxation algorithm. Experimental results with both synthetic and real image sequences are presented to demonstrate the efficacy of the method. In cases where ground truth is known, error estimates for the proposed technique are provided and compared with that for other well-known methods.