A motion correction method includes two steps. The first step includes a global motion correction using the bilinear warping technique and a rough delineation of the lung fields. One of the native images (low energy image, high energy image) is deformed to match the other image. In a second step, local motion corrections are applied to the globally motion corrected image by computing a proximity value in small overlapping tiles. Only tiles with a sufficient high proximity value are taken into account. The maximum shift applied in this second step is limited to a few pixels to avoid strong deformations of the native images.