A computer-implemented method of image rotation correction, the method comprising: receiving (502; 602), at an image correction system, an image (302; 402) comprising image content representing a scene captured by a camera, the image content including a pre-existing rotation about a rotation angle resulting from tilted image acquisition; fitting (504; 606) a mesh to the image content, the mesh having a mesh boundary corresponding to a boundary of the image content; identifying lines corresponding to linear features of the scene in the image content; grouping the lines according to their angle of rotation relative to a reference axis into a plurality of groupings comprising one or more oblique groupings and at least one of a horizontal grouping or a vertical grouping; optimizing (506; 612) the mesh according to an energy function to define an optimized mesh, the energy function comprising: a rotation preservation term encouraging preservation of a desired rotation of the image content to counteract for the pre-existing rotation about the rotation angle, whereby the lines in at least one of the horizontal grouping or the vertical grouping are constrained more strongly to rotate by the rotation angle than the lines in each of the one or more oblique groupings, the rotation preservation term according to the formula: E R θ = ∑ m δ m θ m − Δ 2 + ∑ m θ m − θ m + 1 2 where θ m is a common rotation angle for the m-th grouping, Δ is the rotation angle resulting from tilted image acquisition, δ m is a weighting factor that is larger for the at least one of the horizontal grouping or the vertical grouping, the first term is a data term that encourages rotation of the lines to follow the rotation angle, and the second term is a smoothness term which encourages similarity of rotation for lines in adjacent groupings; a line preservation term minimizing a distortion of line rotation measured from vectors defining a relationship between positions of the endpoints of the lines and vertexes of the mesh; a shape preservation term; and a boundary preservation term to constrain the optimized mesh to the boundary of the image content; and warping (508; 614) the image content according to the optimized mesh to create a corrected image (312; 404). receiving (502; 602), at an image correction system, an image (302; 402) comprising image content representing a scene captured by a camera, the image content including a pre-existing rotation about a rotation angle resulting from tilted image acquisition; fitting (504; 606) a mesh to the image content, the mesh having a mesh boundary corresponding to a boundary of the image content; identifying lines corresponding to linear features of the scene in the image content; grouping the lines according to their angle of rotation relative to a reference axis into a plurality of groupings comprising one or more oblique groupings and at least one of a horizontal grouping or a vertical grouping; optimizing (506; 612) the mesh according to an energy function to define an optimized mesh, the energy function comprising: a rotation preservation term encouraging preservation of a desired rotation of the image content to counteract for the pre-existing rotation about the rotation angle, whereby the lines in at least one of the horizontal grouping or the vertical grouping are constrained more strongly to rotate by the rotation angle than the lines in each of the one or more oblique groupings, the rotation preservation term according to the formula: E R θ = ∑ m δ m θ m − Δ 2 + ∑ m θ m − θ m + 1 2 where θ m is a common rotation angle for the m-th grouping, Δ is the rotation angle resulting from tilted image acquisition, δ m is a weighting factor that is larger for the at least one of the horizontal grouping or the vertical grouping, the first term is a data term that encourages rotation of the lines to follow the rotation angle, and the second term is a smoothness term which encourages similarity of rotation for lines in adjacent groupings; a line preservation term minimizing a distortion of line rotation measured from vectors defining a relationship between positions of the endpoints of the lines and vertexes of the mesh; a shape preservation term; and a boundary preservation term to constrain the optimized mesh to the boundary of the image content; and where θ m is a common rotation angle for the m-th grouping, Δ is the rotation angle resulting from tilted image acquisition, δ m is a weighting factor that is larger for the at least one of the horizontal grouping or the vertical grouping, the first term is a data term that encourages rotation of the lines to follow the rotation angle, and the second term is a smoothness term which encourages similarity of rotation for lines in adjacent groupings; a line preservation term minimizing a distortion of line rotation measured from vectors defining a relationship between positions of the endpoints of the lines and vertexes of the mesh; a shape preservation term; and a boundary preservation term to constrain the optimized mesh to the boundary of the image content; and warping (508; 614) the image content according to the optimized mesh to create a corrected image (312; 404).