Heart image analysis is a challenging and important process used for a range of purposes such as image based measurement, visualization, etc. The most important step in medical image analysis is segmentation. In this work we present an algorithm for CT heart image segmentation. The segmentation is based on two basic pieces of information, pixels brightness and motion. The motion information is gathered as the optical flow information. Such information is later used for definition of an energy function for image labeling. This energy function represents a Markov random field (MRF) posterior distribution function. The MAP estimation of the segmented image has been determined using the simulated annealing (SA) algorithm.