CN1963840A - Method and apparatus for correcting direction of image - Google Patents
Method and apparatus for correcting direction of image Download PDFInfo
- Publication number
- CN1963840A CN1963840A CN 200610164833 CN200610164833A CN1963840A CN 1963840 A CN1963840 A CN 1963840A CN 200610164833 CN200610164833 CN 200610164833 CN 200610164833 A CN200610164833 A CN 200610164833A CN 1963840 A CN1963840 A CN 1963840A
- Authority
- CN
- China
- Prior art keywords
- image
- degree
- face
- angle
- spent
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 230000001815 facial effect Effects 0.000 claims description 30
- 238000012360 testing method Methods 0.000 abstract 2
- 210000003128 head Anatomy 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000002950 deficient Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 230000035807 sensation Effects 0.000 description 1
Images
Abstract
This invention discloses one image direction correction device, which comprises the following parts: a, face tester to test whether there is face images, if yes, then testing the said face image and positive direction relative position according to preset positive direction; b, image rotation device to rotate according to face relative direction to get face image basic positive direction. This invention also discloses one image direction correction method.
Description
Technical field
The present invention relates to image processing field, particularly a kind of apparatus for correcting direction of image and method.
Technical background
In the life, we can obtain including the image of face-image by all means, are forward with face direction straight up on the general custom, and as shown in Figure 1a, people's face is forward.But some the time; obtain being in the facial image that includes of non-forward through regular meeting; when taking personage's photograph with digital camera; because find a view or make things convenient for the needs of grasping camera; sometimes camera is setting, upset or oblique; but when image is preserved, still preserve, promptly save as the image of the non-forward shown in Fig. 1 b or Fig. 1 c by the general preservation direction of image.People need be according to the direction of personage in the photograph with these photographs of camera playback the time like this, and the setting of adjustment camera frequently or upset are so that watch, and be very inconvenient; And, after photograph is imported computer, also need by hand more than in photograph to be rotated correction, conveniently to watch and to edit.Along with the generally use of digital camera and large-capacity memory card, the quantity of photograph is doubled and redoubled, thereby has brought huge workload for manual rotation correction photograph.If the amount of image is very big, manual correction image workload is big, and error rate also can correspondingly increase.
Summary of the invention
At above-mentioned defective of the prior art, purpose of the present invention just is to provide a kind of apparatus for correcting direction of image and method, the image direction that can contain facial characteristics from normal moveout correction makes the face-image in the photograph be in forward substantially, so that preview and post-processed.
In order to achieve the above object, the invention provides a kind of apparatus for correcting direction of image, comprising:
Face detector is used for detected image and whether contains effective face-image, if any, then according to predefined forward, detect the relative direction of described face-image and described forward;
The figure image rotator is used for according to the relative direction of described face image being rotated, to obtain the facial image that is forward substantially.
Further, described face detector is whether the combination by the arbitrary characteristics of facial characteristics such as the eyes in the detected image, nose, face, ear, face contour is contained face-image, and the result of facial relative direction.
Further, described face detector detects and obtains face center A, and the mid point M between two, be to name a person for a particular job that described A, M are continuous to obtain a ray AM with described A, calculates the angle theta of described AM and described pre-set forward; Described figure image rotator is rotated image according to described angle theta value, makes through postrotational AM ' to drop in the predetermined angle β scope that is forward substantially with the angle theta of forward.
Further, the angle of described rotation is the integral multiple of 90 degree.
Further, described face detector is got any as initial point in image, set up a coordinate system, is 0 degree with level direction to the right, and angle 90 degree of setting straight up are the forward angle; Preestablishing the described scope that is the angle β of forward substantially is 45 degree≤β≤135 degree, and then described figure image rotator is specially the rotation of image:
1) when 0 degree≤θ<45 degree and 315 degree<θ<360 are spent, 270 degree or be rotated counterclockwise 90 and spend turn clockwise;
2) when 45 degree≤θ≤135 are spent, do not rotate;
3) when 135 degree<θ<225 are spent, be rotated counterclockwise 270 degree or dextrorotation and turn 90 degrees;
4) when 225 degree<θ<315 are spent, revolve counterclockwise or the dextrorotation turnback;
5) when θ=225 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation;
6) when θ=315 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation.
Further, if a plurality of effective face-images are arranged in the image, then each face-image is all obtained the direction of its relative forward, got its average then, obtain an average relative direction, average in view of the above relative direction is rotated described image.
The present invention also provides a kind of correcting direction of image method, comprising:
Whether contain effective face-image in the detected image, if any, then detect the relative direction of described face-image and described forward according to predefined forward;
Relative direction according to described face is rotated image, to obtain the facial image that is forward substantially.
Further, whether the combination of the arbitrary characteristics by facial characteristics such as the eyes in the detected image, nose, face, ear, face contours is contained face-image, and the result of facial relative direction.
Further, at first detecting and obtain face center A, and the mid point M between two, be to name a person for a particular job that described A, M are continuous to obtain a ray AM with described A then, calculates the angle theta of described AM and described forward; According to described angle theta value image is rotated then, makes angle theta through postrotational AM ' and forward ' drop in the predetermined angle β scope that is forward substantially.
Further, the angle of described rotation is the integral multiple of 90 degree.
Further, getting any as initial point in image, set up a coordinate system, is 0 degree with level direction to the right, and angle 90 degree of setting straight up are the forward angle; Preestablishing the described scope that is the angle β of forward substantially is 45 degree≤β≤135 degree, and then described rotation to image is specially:
1) when 0 degree≤θ<45 degree and 315 degree<θ<360 are spent, 270 degree or be rotated counterclockwise 90 and spend turn clockwise;
2) when 45 degree≤θ≤135 are spent, do not rotate;
3) when 135 degree<θ<225 are spent, be rotated counterclockwise 270 degree or dextrorotation and turn 90 degrees;
4) when 225 degree<θ<315 are spent, revolve counterclockwise or the dextrorotation turnback;
5) when θ=225 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation;
6) when θ=315 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation.
Further, if a plurality of face-images are arranged in the image, then each face-image is all obtained the direction of its relative forward, got its average then, obtain an average relative direction, average in view of the above relative direction is rotated described image.
The inventive system comprises face detector and figure image rotator, utilize face detector to detect in the photograph whether contain face-image, if any, then detect facial relative direction; The rotation that utilizes the figure image rotator to come photograph is carried out certain angle according to the relative direction of face is to obtain the facial photograph that is forward substantially.Utilize apparatus and method of the present invention, can the photograph that contain face-image be rotated automatically,, saved manpower and time in a large number simultaneously to make things convenient for preview and post-processed.
Description of drawings
Fig. 1 is the schematic images of the forward and the non-forward of image;
Fig. 2 is the theory diagram of apparatus for correcting direction of image of the present invention;
Fig. 3 is the facial principle schematic that detects of the present invention;
The direct picture that Fig. 4 obtains after rotation for the image that is in non-forward among Fig. 1;
Fig. 5 is the inventive method process flow diagram.
Embodiment
Core concept of the present invention is at first whether to contain effective face-image in the detected image, if any, then detect relative direction facial and forward; Utilize the figure image rotator according to the facial rotation that comes image is carried out certain angle with the relative direction of forward, to obtain the facial image that is forward substantially.
Effective face-image of indication of the present invention, for enough in order to obtain the face-image of facial relative direction.For example, during people's face in the prior art detected, general facial lateral deflection can obtain facial relative direction in 20 degree, promptly can be considered as effective face at 20 degree of deflection at present with interior face-image.
Below in conjunction with accompanying drawing, further describe apparatus and method of the present invention.
As shown in Figure 2, apparatus for correcting direction of image of the present invention comprises: face detector, and be used for detected image and whether contain effective face-image, if any, then detect the relative direction of described face-image according to predefined forward; Also comprise the figure image rotator, be used for image being rotated, to obtain the facial image that is forward substantially according to the relative direction of described face.
Described face can be the face of personage or animal, and following narration rotates to be example with the image that comprises personage's face, can carry out with reference to following method for detection of the face outside the personage and image rotation, is no longer given unnecessary details.
People's face has a plurality of features such as eyes, nose, face, face contour, and following narration is an example with eyes and the face of personage in the detected image, whether is contained personage's face-image, and the personage is facial and the relative direction of forward.By the combination of other facial characteristics, wait the method that detects facial direction that embodiment is arranged in the prior art as eyes and nose, nose and face contour, face contour and ear, and be not emphasis of the present invention place, so do not repeat them here.
As shown in Figure 3, face detector can be got any as initial point in image, and this point can be the center of face, sets up a coordinate system, is 0 degree with level direction to the right, and angle 90 degree of setting straight up are the forward angle.
The step that detects the facial relative direction of personage is specifically as follows: 1) obtain face center A, and the mid point M between two, the method that detects face and eyes is a prior art, will not describe in detail herein; 2) be that name a person for a particular job described A, M links to each other and to obtain a ray AM with described A, calculated the angle theta of described AM and described forward, suppose θ=325 degree, can obtain the direction of the relative forward of personage's face.
Described figure image rotator is rotated image according to described angle theta value, makes through postrotational AM ' to drop in the predetermined angle β scope that is forward substantially with the angle theta of forward.In the present embodiment, the scope of described β is 45 degree≤β≤135.That is, when personage's face-image is positioned at this angular range, think that image is a forward.
When described figure image rotator is rotated image, can rotate clockwise, but also counterclockwise rotation.The angle of being rotated can be arbitrary value, needs only through postrotational angle theta in the β scope.But the anglec of rotation is preferably the integral multiple of 90 degree, as 90 degree, 180 degree, 270 degree.Still parallel through two limits of postrotational image like this with surface level, give the more stable sensation of people.
What, can determine by following rule for concrete rotation angle.With reference to figure 3, be 90 degree because preestablished forward in this example, the scope that is the angle β of forward substantially is 45 degree≤β≤135 degree, then described figure image rotator is specially the rotation of image:
1) when 0 degree≤θ<45 degree and 315 degree<θ<360 are spent, 270 degree or be rotated counterclockwise 90 and spend turn clockwise;
2) when 45 degree≤θ≤135 are spent, do not rotate; Note, when θ=45 degree or 135 degree, also can be rotated, but be as good as substantially before postrotational effect and the rotation, so can not rotate;
3) when 135 degree<θ<225 are spent, be rotated counterclockwise 270 degree or dextrorotation and turn 90 degrees;
4) when 225 degree<θ<315 are spent, revolve counterclockwise or the dextrorotation turnback;
5) when θ=225 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation;
6) when θ=315 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation.
After two images processes rotation as Fig. 1 b and Fig. 1 c, can be the image shown in Fig. 4 b and Fig. 4 c.Its personage's head portrait is forward substantially.
In addition, if a plurality of personage's face-images are arranged in the image, then can all obtain θ to each personage's head portrait, then described a plurality of θ values be averaged, to obtain the direction of an average relative forward, mean value is rotated described image in view of the above.Perhaps, also can select one of them head portrait, calculate its θ value.In actual use, can decide as the case may be.
Introduce the method for correcting direction of image of the present invention below.As shown in Figure 5, may further comprise the steps:
100) detect the face-image that whether contains the personage in the image of input, if any, then execution in step 200) detect the relative direction of described face-image according to predefined forward; Otherwise finish this treatment of picture;
300) relative direction according to described face is rotated image, to obtain the image that personage's face is forward substantially.
Whether face detector of the present invention can be contained personage's face-image by eyes and the face of personage in the detected image, and the personage is facial and the relative direction of forward.
Detecting the method for the facial direction of personage and the concrete grammar of rotation all has detailed introduction in aforementioned description to device, will not give unnecessary details a bit.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement etc., all should be included within protection scope of the present invention.
Claims (12)
1, a kind of apparatus for correcting direction of image is characterized in that, comprising:
Face detector is used for detected image and whether contains effective face-image, if any, then according to predefined forward, detect the relative direction of described face-image and described forward;
The figure image rotator is used for according to the relative direction of described face image being rotated, to obtain the facial image that is forward substantially.
2, device according to claim 1, it is characterized in that, described face detector is whether the combination by the arbitrary characteristics of facial characteristics such as the eyes in the detected image, nose, face, ear, face contour is contained face-image, and the result of facial relative direction.
3, device according to claim 2, it is characterized in that described face detector detects and obtains face center A, and the mid point M between two, with described A has been that name a person for a particular job described A, M links to each other and to obtain a ray AM, calculates the angle theta of described AM and described pre-set forward; Described figure image rotator is rotated image according to described angle theta value, makes through postrotational AM ' to drop in the predetermined angle β scope that is forward substantially with the angle theta of forward.
4, device according to claim 3 is characterized in that, the angle of described rotation is the integral multiple of 90 degree.
5, device according to claim 4 is characterized in that, described face detector is got any as initial point in image, set up a coordinate system, is 0 degree with level direction to the right, and angle 90 degree of setting straight up are the forward angle; Preestablishing the described scope that is the angle β of forward substantially is 45 degree≤β≤135 degree, and then described figure image rotator is specially the rotation of image:
1) when 0 degree≤θ<45 degree and 315 degree<θ<360 are spent, 270 degree or be rotated counterclockwise 90 and spend turn clockwise;
2) when 45 degree≤θ≤135 are spent, do not rotate;
3) when 135 degree<θ<225 are spent, be rotated counterclockwise 270 degree or dextrorotation and turn 90 degrees;
4) when 225 degree<θ<315 are spent, revolve counterclockwise or the dextrorotation turnback;
5) when θ=225 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation;
6) when θ=315 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation.
6, device according to claim 1 is characterized in that, if a plurality of effective face-images are arranged in the image, then each face-image is all obtained the direction of its relative forward, get its average then, obtain an average relative direction, average in view of the above relative direction is rotated described image.
7, a kind of correcting direction of image method is characterized in that, comprising:
Whether contain effective face-image in the detected image, if any, then detect the relative direction of described face-image and described forward according to predefined forward;
Relative direction according to described face is rotated image, to obtain the facial image that is forward substantially.
8, method according to claim 7 is characterized in that, whether the combination of the arbitrary characteristics by facial characteristics such as the eyes in the detected image, nose, face, ear, face contours is contained face-image, and the result of facial relative direction.
9, method according to claim 8 is characterized in that, at first detect and obtain face center A, and the mid point M between two, and be to name a person for a particular job that described A, M are continuous to obtain a ray AM with described A then, calculate the angle theta of described AM and described forward; According to described angle theta value image is rotated then, makes angle theta through postrotational AM ' and forward ' drop in the predetermined angle β scope that is forward substantially.
10, method according to claim 9 is characterized in that, the angle of described rotation is the integral multiple of 90 degree.
11, method according to claim 10 is characterized in that, gets any as initial point in image, sets up a coordinate system, is 0 degree with level direction to the right, and angle 90 degree of setting straight up are the forward angle; Preestablishing the described scope that is the angle β of forward substantially is 45 degree≤β≤135 degree, and then described rotation to image is specially:
1) when 0 degree≤θ<45 degree and 315 degree<θ<360 are spent, 270 degree or be rotated counterclockwise 90 and spend turn clockwise;
2) when 45 degree≤θ≤135 are spent, do not rotate;
3) when 135 degree<θ<225 are spent, be rotated counterclockwise 270 degree or dextrorotation and turn 90 degrees;
4) when 225 degree<θ<315 are spent, revolve counterclockwise or the dextrorotation turnback;
5) when θ=225 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation;
6) when θ=315 are spent, rotate to miter angle or place, 135 degree angle, but clockwise or counterclockwise rotation.
12, method according to claim 7 is characterized in that, if a plurality of face-images are arranged in the image, then each face-image is all obtained the direction of its relative forward, get its average then, obtain an average relative direction, average in view of the above relative direction is rotated described image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006101648337A CN100440248C (en) | 2006-12-06 | 2006-12-06 | Method and apparatus for correcting direction of image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006101648337A CN100440248C (en) | 2006-12-06 | 2006-12-06 | Method and apparatus for correcting direction of image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1963840A true CN1963840A (en) | 2007-05-16 |
CN100440248C CN100440248C (en) | 2008-12-03 |
Family
ID=38082883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006101648337A Expired - Fee Related CN100440248C (en) | 2006-12-06 | 2006-12-06 | Method and apparatus for correcting direction of image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100440248C (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104838420A (en) * | 2012-11-16 | 2015-08-12 | 谷歌公司 | Rotation of image based on image content to correct image orientation |
CN106874861A (en) * | 2017-01-22 | 2017-06-20 | 北京飞搜科技有限公司 | A kind of face antidote and system |
CN106909880A (en) * | 2017-01-16 | 2017-06-30 | 北京龙杯信息技术有限公司 | Facial image preprocess method in recognition of face |
CN108388857A (en) * | 2018-02-11 | 2018-08-10 | 广东欧珀移动通信有限公司 | Method for detecting human face and relevant device |
CN113657379A (en) * | 2021-08-09 | 2021-11-16 | 杭州华橙软件技术有限公司 | Image processing method, image processing device, computer-readable storage medium and processor |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4453365B2 (en) * | 2004-01-09 | 2010-04-21 | セイコーエプソン株式会社 | Image layout apparatus, image layout program, and image layout method |
CN1797420A (en) * | 2004-12-30 | 2006-07-05 | 中国科学院自动化研究所 | Method for recognizing human face based on statistical texture analysis |
-
2006
- 2006-12-06 CN CNB2006101648337A patent/CN100440248C/en not_active Expired - Fee Related
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104838420A (en) * | 2012-11-16 | 2015-08-12 | 谷歌公司 | Rotation of image based on image content to correct image orientation |
CN104838420B (en) * | 2012-11-16 | 2018-04-20 | 谷歌有限责任公司 | Image content-based carries out image rotation to correct image orientation |
CN106909880A (en) * | 2017-01-16 | 2017-06-30 | 北京龙杯信息技术有限公司 | Facial image preprocess method in recognition of face |
CN106874861A (en) * | 2017-01-22 | 2017-06-20 | 北京飞搜科技有限公司 | A kind of face antidote and system |
CN108388857A (en) * | 2018-02-11 | 2018-08-10 | 广东欧珀移动通信有限公司 | Method for detecting human face and relevant device |
CN113657379A (en) * | 2021-08-09 | 2021-11-16 | 杭州华橙软件技术有限公司 | Image processing method, image processing device, computer-readable storage medium and processor |
Also Published As
Publication number | Publication date |
---|---|
CN100440248C (en) | 2008-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100440248C (en) | Method and apparatus for correcting direction of image | |
CN109062531A (en) | The display methods and display control unit of mosaic screen and mosaic screen | |
CN106768383B (en) | A kind of automatic blind element detection of infrared focal plane array and compensation method | |
CN101216883B (en) | A photography method and device | |
CN104994281B (en) | A kind of method and terminal of face distortion correction | |
WO2020252910A1 (en) | Image distortion correction method, apparatus, electronic device and readable storage medium | |
CN106709899A (en) | Dual-camera relative position calculation method, device and equipment | |
CN103888654B (en) | It takes pictures and corrects system and method | |
CN111598038B (en) | Facial feature point detection method, device, equipment and storage medium | |
CN103838367A (en) | Orientation correction method for electronic device used to perform facial recognition and electronic device thereof | |
CN106713288A (en) | Fraud risk identification and prevention method and system | |
WO2017215351A1 (en) | Method and apparatus for adjusting recognition range of photographing apparatus | |
CN107864341A (en) | One kind drop frame per second photographic method, mobile terminal and storage medium | |
CN107481283A (en) | A kind of robot localization method, apparatus and robot based on CCTV camera | |
JP2014151398A5 (en) | Spectacle lens peripheral processing system, spectacle lens peripheral processing program, and spectacle lens peripheral processing apparatus | |
CN106648344A (en) | Screen content adjustment method and equipment | |
CN109982038A (en) | Show the method, apparatus and computer equipment of sound source position | |
US20240049985A1 (en) | Methods of selecting surgical implants and related devices | |
CA2948530A1 (en) | Systems and methods for scaling an object | |
CN105913403A (en) | Image denoising method and system | |
CN104166500A (en) | Method, system and terminal for providing reference coordinate systems in lens image | |
CN105654101B (en) | A kind of information processing method and electronic equipment | |
AU2021204542A1 (en) | Alarm method and apparatus for tabletop game, electronic device and storage medium | |
JP2019149119A5 (en) | ||
CN111586383A (en) | Method and device for projection and projection equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20081203 Termination date: 20111206 |