1. A method of automatic image registration comprising: receiving a first image and a second image both images being of objects and with at least part of one object being common to both images; for each of the first and second images computing a probability map comprising, for each image element, a probability that the image element is of a specified object; finding a mapping to register the first and second images by optimizing an energy function which is a function of the intensities of the first and second images and also of the probability maps.