A computer-implemented method, comprising: determining a first image area corresponding to a first region of interest in an image (200, 1410, 1510); determining a warping mesh for the image, wherein the warping mesh comprises a number of rows NR, a number of columns NC and a plurality of vertices NR*NC; determining a first portion of the warping mesh associated with the first image area; determining a cost function for the warping mesh by: determining first costs associated with the first portion of the warping mesh, wherein the first costs comprise costs associated with one or more face-related transformations of at least the first image area to correct one or more geometric distortions of the first region of interest as represented in the image, and determining second costs associated with the warping mesh, wherein the second costs comprise costs of one or more edge-related transformations for preserving straightness of edges represented in the image modified at least by the one or more face-related transformations; determining an optimized mesh based on an optimization of the cost function, wherein determining an optimized mesh comprises performing a numerical minimization of sums of the first and second costs associated with the vertices of the warping mesh; and modifying the first image area of the image based on the optimized mesh. determining a first image area corresponding to a first region of interest in an image (200, 1410, 1510); determining a warping mesh for the image, wherein the warping mesh comprises a number of rows NR, a number of columns NC and a plurality of vertices NR*NC; determining a first portion of the warping mesh associated with the first image area; determining a cost function for the warping mesh by: determining first costs associated with the first portion of the warping mesh, wherein the first costs comprise costs associated with one or more face-related transformations of at least the first image area to correct one or more geometric distortions of the first region of interest as represented in the image, and determining second costs associated with the warping mesh, wherein the second costs comprise costs of one or more edge-related transformations for preserving straightness of edges represented in the image modified at least by the one or more face-related transformations; determining first costs associated with the first portion of the warping mesh, wherein the first costs comprise costs associated with one or more face-related transformations of at least the first image area to correct one or more geometric distortions of the first region of interest as represented in the image, and determining second costs associated with the warping mesh, wherein the second costs comprise costs of one or more edge-related transformations for preserving straightness of edges represented in the image modified at least by the one or more face-related transformations; determining an optimized mesh based on an optimization of the cost function, wherein determining an optimized mesh comprises performing a numerical minimization of sums of the first and second costs associated with the vertices of the warping mesh; and modifying the first image area of the image based on the optimized mesh.