grayscaled and normalized images. Inverse affine working