This application is the U.S. National Stage Entry under 35 U.S.C. §371 of International Application No. PCT/CN2014/076399, filed on Apr. 28, 2014.
The present invention relates to the field of image processing, in particular to a method for detecting the horizontal and gravity directions of an image.
Detection of the horizontal and gravity directions of an image can be used in vehicle rollover warning, image tilt detection and so on, wherein the image tilt detection can be used in such applications as automatic scanning of images and image correction.
In the field of vehicle control, rollover prevention is an important aspect. The existing vision-based methods usually employ specific reference objects or are based on prior knowledge of the known environments, so they are suitable for highly structured road environments, but these methods lack universality and adaptability in unknown environments.
On the other hand, the methods that use the widely-employed inertial navigation system for roll attitude estimation so as to prevent rollover has the problem of error accumulation in addition to its high cost.
As far as automatic scanning of images and image correction are concerned, the prior arts mostly focus on detecting tilt angles of the text images, while for non-text images, there is no universal solution.
Directing at the defect in the prior art, the purpose of the present invention is to provide a method for detecting the horizontal and gravity directions of an image to realize effective and accurate detection.
In order to achieve the above-mentioned purpose, the present invention provides a method for detecting the horizontal and gravity directions of an image, which is used for gray images and comprises:
as a kernel function to obtain a function
wherein α is a given constant and βε[0, π/2), and then obtaining the horizontal and gravity identification angles {argmaxMCGCS(β), argmaxMCGCS(β)+π/2}.
Further, in said step S1, the diameter of the sampling circle of the attention focus detector is 0.06 times of the short side length of the image.
Further, said step S2 specifically includes:
Further, a receptive field response function of the orientation perceptron in step S3 is
and (x, y) is the coordinate of a point in the receptive field; kj, rj, αj(j=1, 2, 3), lφ, wφ are parameters of the receptive field response function.
Further, said step S3 specifically includes:
The method for detecting the horizontal and gravity directions of an image according to the present invention has a fast processing speed and good effect, and it is suitable for direction detection for images with the presence of actual gravity or sensory gravity, such as paintings, natural images, texts and so on.
The technical solution of the present invention will be described in further detail below by means of the embodiments and with reference to the drawings.
For gray images, the present invention uses an attention focus detector to acquire all attention focus coordinates and the corresponding significant orientation angles in the image coordinate system to constitute a set Ωp, and for each element in Ωp, an orientation perceptron is used to construct a corresponding local orientation function Diri(θ) according to gray image information, and then an image direction function PI(θ) is obtained by summing. On this basis, a horizontal and gravity identification is performed to obtain the horizontal and gravity identification angles, thereby completing detection of the horizontal and gravity directions of the image.
Step 102: placing the center of the sampling circle of the attention focus detector on each of the sampling points respectively, and using the attention focus detector to acquire attention focus coordinates (xi, yi) and the corresponding significant orientation angle γi (γiε[0, π), wherein the subscript i is corresponding to the ith attention focus and i is a natural number, and all attention focus coordinates and the corresponding significant orientation angles constitute a set Ωp.
Specifically, step 102 includes following steps:
For each pixel point through which the sampling circle passes, making a normal line segment having a length of ⅕ of the diameter along a normal direction by using the pixel point as the central point, and calculating a gray mean of the pixels through which each normal line segment passes, and then on the sampling circle, calculating a difference between two gray means obtained from pixel points having a spacing of 1/15 of the diameter, and acquiring an absolute value dk of the difference. If the maximum one of the absolute values of the differences does not exceed a given threshold T0, it means that no attention focus has been detected and the attention focus detector stops detecting, otherwise, the central point of the short arc formed between the two pixel points corresponding to the maximum one of the absolute values of the differences is used as the first gray sudden change point pm.
Step 1022: calculating gray means Gup, Gdown, Gleft and Gright for four square areas, which are above, below, to the left and to the right of the first gray sudden change point pm and whose side lengths are 1/10 of the diameter, and calculating an angle Cpm according to the following formula:
Step 1023: constructing a chord from the first gray sudden change point pm along a direction perpendicular to Cpm, said chord intersecting with the sampling circle at another intersection point po, and searching for a second gray sudden change point near the intersection point po along the sampling circle, if the second gray sudden change point does not exist, said attention focus detector stops detecting; if the second gray sudden change point exists, it is marked as pm′, and the central point of the line pmpm′ between the first gray sudden change point and the second gray sudden change point is used as the attention focus, whose coordinate is marked as (xi, yi), and the orientation of the chord pmpm′ is used as the corresponding significant orientation angle γi (γiε[0, π)).
Step 1024: constituting a set Ωp using all of the attention focus coordinates and the corresponding significant orientation angles.
Step 103: for each element (xi, yi, γi) in the set Ωp, using an orientation perceptron to determine a local orientation angle αi (αiε[0, π)) and a weight ηi at the attention focus (xi, yi) near the significant orientation angle γi according to the gray image information, and generating a local orientation function Diri(θ)=ηie−(θ-α
The orientation perceptron in step 103 simulates simple cells in cerebral visual cortex, and the receptive field response function of the orientation perceptron is
and (x, y) is the coordinate of a point in the receptive field; kj, rj, αj(j=1, 2, 3), l100, wφ are parameters of the receptive field response function.
Step 103 specifically includes following steps:
as a kernel function to obtain a function
wherein α is a given constant and βε[0, π/2), and then obtaining the horizontal and gravity identification angles {argmaxMCGCS(β), argmaxMCGCS(β)+π/2}.
In a specific embodiment, lφ is 0.06 times of the short side length of the image, k1=200, k2=k3=−60, r1=0.424lφ, r2=1.3lφ, r3=−1.3l100, a1=0, a2=a3=0.1lφ, wφ=0.5lφ, T0=20, δ2=0.1, δ1=π/3, T1=0.1, α=π3.
The method for detecting the horizontal and gravity directions of an image according to the present invention has a fast processing speed and good effect, and it is suitable for direction detection of images with the presence of actual gravity or sensory gravity, such as paintings, natural images, texts and so on. Said method is promising for applications particularly in fields such as vehicle rollover warning, automatic scanning of images and image correction.
Professionals shall be able to further realize that the exemplary units and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of both, and in order to clearly illustrate the interchangeability between the hardware and software, components and steps of each example have been generally described according to the functions thereof in the above texts. As for whether said functions are achieved by hardware or by software, it depends on the specific application and restrictions for the design of the technical solution. Professionals can use different methods for each specific application to realize the described functions, while such realization should not be considered as going beyond the scope of the present invention.
Steps of the method or algorithm described in conjunction with embodiments disclosed herein can be carried out by hardware, software modules executed by a processor, or a combination of both. The software modules may reside in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable and programmable ROM, a register, a hard disc, a movable disc, a CD-ROM, or any other forms of storage medium known in the art.
The above-described specific embodiments further illustrate the object, technical solution and beneficial effect of the present invention. But it shall be understood that the above descriptions are merely the specific embodiments of the present invention, hut they are not intended to limit the protection scope of the present invention. Any modification, equivalent substitution and improvement made under the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2014/076399 | 4/28/2014 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2015/165015 | 11/5/2015 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5574498 | Sakamoto | Nov 1996 | A |
20100302410 | Naito | Dec 2010 | A1 |
20130050529 | Murayama | Feb 2013 | A1 |
20140254874 | Kurz | Sep 2014 | A1 |
20170104900 | Kitaya | Apr 2017 | A1 |
Number | Date | Country | |
---|---|---|---|
20170046855 A1 | Feb 2017 | US |