A method is for determining a transformation for image registration of a first image relative to a second image. The method includes ascertaining a test series of test elements including a test transformation and a test value, the ascertaining including ascertaining the test transformation based on a sequence of test transformations and/or based on previously ascertained test elements, transforming the first image via the ascertained test transformation, ascertaining a difference image, and ascertaining the test value of the test element based on the difference image such that the test value is a measure for an extension of a frequency distribution of values of pixels of the difference image in a direction of pixel value increase. It further includes determining a minimum test value based on test values encompassed by the test elements and determining the transformation which is the test transformation of a test element including the minimum test value.