# US 2015/0147003 A1 · Content-Aware Image Rotation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2015/0147003 A1
- Document ID: US20150147003A1
- Status: Published application
- Kind: A1
- Application number: 14/092,032
- Filed: 2013-11-27
- Published: 2015-05-28
- Earliest claimed: 2013-11-27
- Assignees: Microsoft Corporation
- Applicants: Microsoft Corporation
- Inventors: Kaiming He; Huiwen Chang; Jian Sun
- Web page: https://patentgrep.com/patent/US20150147003A1

## CPC

- G06T 3/04: Context-preserving transformations, e.g. by using an importance map (panospheric to cylindrical image transformations G06T3/12)
- G06T 3/60: Rotation of whole images or parts thereof
- G06T 3/608: by skew deformation, e.g. two-pass or three-pass rotation
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

According to implementations of this disclosure, image content is rotated in a content-aware fashion. In one implementation, a mesh is formed over an image and image lines in the image content are identified. The image is warped using an energy function that rotates a subset of the lines a predetermined rotation angle, while rotating other lines by an angle other than the predetermined rotation angle. In one example, lines that are intended to be horizontal or vertical after correcting are rotated by a rotation angle that will make them horizontal or vertical, whereas oblique lines are rotated by an angle other than the rotation angle.

## Claims

### Claim 1

A system comprising:
one or more processors;
memory, communicatively coupled to the one or more processors, storing executable instructions that, when executed by the one or more processors, configure the one or more processors to perform acts comprising:
receiving an input image containing image content, the image content being rotated about a rotation angle;
identifying lines corresponding to linear features in the image content;
fitting a mesh to the image content, the mesh having a mesh boundary corresponding to a boundary of the image content;
grouping the lines in a plurality of groupings comprising one or more oblique groupings and at least one of a horizontal grouping or a vertical grouping;
optimizing the mesh according to an energy function to define an optimized mesh, the energy function comprising:
a rotation preservation term encouraging preservation of a rotation of the image content to counteract for the rotation about the rotation angle;
a line preservation term defining a relationship between 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
deforming the image content according to the optimized mesh to produce a corrected image.

### Claim 2 (depends on 1)

The system of claim 1, wherein the deforming the image content includes rotating lines appearing in the corrected image as horizontal or vertical lines by the rotation angle.

### Claim 3 (depends on 2)

The system of claim 2, wherein the deforming the image content includes rotating lines appearing in the corrected image as oblique lines by an angle other than the rotation angle.

### Claim 4 (depends on 1)

The system of claim 1, wherein the corrected image contains all of the image content of the input image.

### Claim 5 (depends on 4)

The system of claim 4, wherein the corrected image contains only the image content of the input image.

### Claim 6 (depends on 1)

The system of claim 1, wherein the optimizing the mesh comprises optimizing the energy function.

### Claim 7 (depends on 6)

The system of claim 6, wherein the optimizing the energy function includes using a half-quadratic splitting technique.

### Claim 8

A computer readable media having stored thereon processor-executable instructions that, upon execution, configure a processor to perform acts comprising:
creating an input mesh on an input image, the input image being tilted relative to a desired orientation;
optimizing the input mesh according to an energy function having a rotation preservation term, a line preservation term, a shape preservation term, and a boundary preservation term to create an optimized mesh; and
deforming the image according to the optimized mesh to produce a corrected image, wherein lines in the corrected image are rotated relative to lines in the input image.

### Claim 9 (depends on 8)

The computer readable media of claim 8, the acts further comprising:
identifying horizontal lines and vertical lines in the input image tilted by a rotation angle relative to a true horizontal; and
identifying oblique lines in the image titled by an angle other than the rotation angle relative to the true horizontal,
wherein the deforming the image according to the optimized mesh causes the horizontal lines and the vertical lines to be rotated by the rotation angle and the oblique lines to be rotated by an angle other than the rotation angle.

### Claim 10 (depends on 9)

The computer readable media of claim 9, wherein the horizontal lines, vertical lines and the oblique lines comprise line segments, at least some of which are segmented by the input mesh.

### Claim 11 (depends on 9)

The computer readable media of claim 9, further comprising grouping the horizontal lines, the vertical lines, and the oblique lines in a plurality of groupings.

### Claim 12 (depends on 11)

The computer readable media of claim 11, wherein the deforming the image according to the optimized mesh causes all of the lines in each of the plurality of groupings to be rotated by a same angle.

### Claim 13 (depends on 11)

The computer readable media of claim 11, wherein the groupings comprising the oblique lines are characterized by an angle of the oblique lines, and the deforming the image according to the optimized mesh causes lines in adjacent groupings to be rotated by a similar angle.

### Claim 14 (depends on 8)

The computer readable media of claim 8, wherein the input image is defined by an image boundary and the image boundary is preserved by the boundary preservation term of the energy function.

### Claim 15 (depends on 14)

The computer readable media of claim 14, wherein the corrected image is bound by the image boundary.

### Claim 16 (depends on 8)

The computer readable media of claim 8, wherein the shape preservation term includes a similarity transformation for each of a plurality of quadrants of the input mesh.

### Claim 17 (depends on 8)

The computer readable media of claim 8, wherein the line preservation term incorporates a relationship between lines in the image and vertexes of the mesh.

### Claim 18

A method comprising:
receiving at an image correction system an image comprising image content, the image content being rotated by a rotation angle;
identifying lines corresponding to linear features in the image content;
grouping the lines in a plurality of groupings comprising one or more oblique groupings and at least one of a horizontal grouping or a vertical grouping;
deforming the image content to create a corrected image by rotating the lines in the at least one of the horizontal grouping or the vertical grouping by the rotation angle and rotating the lines in each of the one or more oblique groupings by an angle other than the rotation angle.

### Claim 19 (depends on 18)

The method of claim 18, wherein all of the image content is preserved in the deformed image and the deformed image contains no additional image content.

### Claim 20 (depends on 18)

The method of claim 18, wherein the deforming the image content includes deforming the image content about a mesh optimized according to an energy function.
