Patent ID: 9727801
Date: 2017-08-08
CPC Classifications: G06K,G06T

Claim:
1. A computer-implemented method for rotating photos comprising: receiving, at a processor of an electronic device, data related to a photographic image; obtaining, at the processor, an orientation flag value of the photographic image; determining, based on an orientation of the electronic device and the obtained orientation flag value, a rotational value of the photographic image; and rotating the photographic image according to the determined rotational value when the photographic image is displayed on a display screen of the electronic device; wherein step of obtaining the orientation flag value of the photographic image comprises: identifying one or more facial images in the photographic image; selecting a primary facial image from the identified one or more facial images; establishing a virtual coordinate system in the selected primary facial image; mapping a position between two eyes of the primary facial image into the virtual coordinate system to be a target point; forming a straight line between the target point and an origin of the virtual coordinate system, wherein the original of the virtual coordinate system is a center of the mouth of the primary facial image, an X axis of the virtual coordinate system is parallel with and in a same direction as the X axis of a window coordinate system, and a Y axis of the virtual coordinate system is parallel with and in an opposite direction as the Y axis of the window coordinate system; determining an angle value between the straight line and a horizontal axis of the virtual coordinate system; and determining the orientation flag value of the photographic image according to the angle value between the straight line and the X axis of the virtual coordinate system.