Background technology
Actual road often can be divided into structured road and destructuring road two classes, structured road generally is meant highway and part-structureization highway preferably, this class road has lane line and road boundary clearly, therefore, can be reduced to the detection problem of lane line or road boundary at its Road Detection problem.The destructuring road refers generally to the lower road of structuring degree, this class road does not have lane line and road boundary clearly, add shade, water mark, silt etc. and changed the surface characteristics of road again, road area and non-road area more are difficult to distinguish, so still be in conceptual phase at the detection technique of this type of road.
Detection method at road area can be divided three classes at present: based on the method for roadway characteristic, based on the method for road model with based on neural network method.Based on the detection method of roadway characteristic is by analyzing different on color or textural characteristics of road area and non-road area, and the method by cluster or region growing obtains road area.Method based on model is to suppose road model earlier, finds out the road model that mates most according to image, and the detected road area of these class methods is comparatively complete, still for the road pavement form of complexity, can't set up model accurately.Utilize the learning characteristic of neural network based on neural network method, but need a large amount of training sets.Because both limitation on detection and real-time of back generally adopt the detection method based on roadway characteristic at present.
The feature of road area generally has: color and texture.Dividing method based on texture mainly is to utilize gray level co-occurrence matrixes at present, and the method can not satisfy the needs of real-time, and the method for therefore extracting road area at present mainly is to utilize the characteristics of the color basically identical of road, adopts cutting apart based on color.Basic thought is: choose vehicle front one fritter trapezoid area and obtain the standard path color as sample, then or utilize the chromatic information of image directly to cut apart, or carry out after the conversion of color space, cut apart in conjunction with other means such as histograms, or the chromatic information amount is carried out cutting apart after the statistical study again.
Its basic procedure is as shown in Figure 1: a) input picture; B) obtain the Standard Colors of road according to this input picture; C) relatively obtain the road candidate region by other regional color and Standard Colors; D) on the basis of determined candidate region, non-road information is removed in constraints such as utilization is had a lot of social connections, area; E) the definite road area of output.
The major advantage of this method is insensitive to road shape, and the priori that needs is few, and to detect effect for the moment fine when the road color is single.But it depends on choosing of standard path look, and is responsive to shade and water mark, will go wrong when several situation below the existence of road conditions environment:
1) when road has cast shadow, the colouring information that selected image below trapezoid area is contained is incomplete, causes the road area that extracts imperfect;
2) when the body of wall on non-road or car body color are close with road, and when also satisfying certain width requirement, cause the road area that extracts inaccurate;
3) color of road area is not single.
Summary of the invention
In view of the road area based on color detects existing defective, and the difficulty that road boundary extracts in structuring and the destructuring road, the invention provides the road area detection technique that a kind of two class roads all are suitable for, be embodied in a kind of road area detection method and system based on texture.
A kind of road area detection method comprises the steps:
S1: the image that obtains road to be detected;
S2: the described view data of obtaining is handled, determined smooth region;
S3: the smooth region of determining elemental area maximum in the described smooth region;
S4:, determine the road candidate region according to the position relation of the smooth region of other smooth region and described elemental area maximum;
S5: the road candidate region is revised, obtained the final road zone;
Wherein, comprise the steps: among the step S2
S21: the image that obtains is divided into some local zonules;
S22: the gradient of calculating each local zonule; Concrete, calculate each local zonule Grad on assigned direction at first respectively, get the gradient of each local zonule maximal value on assigned direction then as this zonule, part;
S23: determine according to the gradient of each local zonule whether this zonule, part is smooth region.
On the other hand, the invention provides a kind of road area detection system, comprising:
Image acquisition units is used to obtain the image of road to be detected;
Data processing unit, be used for the view data of obtaining is handled, determine smooth region, determine the smooth region of elemental area maximum in the described smooth region, smooth region and the relation of the position between other smooth region according to elemental area maximum in the smooth region, determine the road candidate region, and the road candidate region is revised, obtain the final road zone;
The road area output unit is used to export the road area that finally obtains;
Wherein, described data processing unit comprises:
Smooth region selected cell, the image that is used for obtaining are divided into some local zonules; Calculate the gradient of each local zonule; Concrete, calculate each local zonule Grad on assigned direction at first respectively, get the gradient of the maximal value of each local zonule Grad on assigned direction then as this zonule, part;
The smooth region connected unit is used for determining according to the gradient of each local zonule whether this zonule, part is smooth region;
The morphology amending unit is used for the road candidate region is revised, and obtains the final road zone.
Compared with prior art, the present invention only handles the picture drop-out line with the lower part, solved and existingly cut apart the road area method in the problem of handling aspects such as shade, water mark, road irregular colour be even based on color, both can be applicable to structured road, solve the problem of Boundary Extraction difficulty, can be applicable to the destructuring road again.On the basis that guarantees discrimination, strengthened the real-time and the robustness that detect, method is simple fast effectively.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
The basic procedure of the road area detection method that the embodiment of the invention provided as shown in Figure 2.
S1: the image that obtains road to be detected;
S2: the described view data of obtaining is handled, determined smooth region;
S3: the smooth region of determining elemental area maximum in the described smooth region;
S4:, determine the road candidate region according to the position relation of the smooth region of other smooth region and described elemental area maximum;
S5: the road candidate region is revised, obtained the final road zone;
S5: the road candidate region is revised, obtained the final road zone.
Wherein, comprise the steps: among the step S2
S21: the image that obtains is divided into some local zonules;
S22: the gradient of calculating each local zonule; Concrete, calculate each local zonule Grad on assigned direction at first respectively, get the gradient of each local zonule maximal value on assigned direction then as this zonule, part;
S23: determine according to the gradient of each local zonule whether this zonule, part is smooth region.
On the other hand, the present invention also provides a kind of road area detection system that is used to realize said method, and Fig. 3 is the logical organization synoptic diagram of this system.As shown in Figure 3, road area detection system of the present invention comprises image acquisition units 1, data processing unit 2 and road area output unit 3.Wherein image acquisition units 1 is used to obtain the image of road to be detected, and with this image input data processing unit 2; The image of 2 pairs of inputs of data processing unit carries out a series of pattern recognition process, obtains smooth region, according to the relation of the position between each smooth region, obtains the road candidate region then; Carry out the morphology correction according to the geometry character pair road candidate regions such as area of road again, the final road area image of determining that generates is exported by road area output unit 3.
Wherein, data processing unit 2 comprises smooth region selected cell 21, smooth region connected unit 22 and morphology amending unit 23.
Smooth region selected cell 21 comprises Region Segmentation unit 211 and gradient calculation unit 212, wherein Region Segmentation unit 211 image that is used for coming from image acquisition units 1 is divided into several local zonules, gradient calculation unit 212 is used to calculate the gradient of each local zonule and weighs their flatness with this, thereby determines the smooth region in the image.
Smooth region connected unit 22 comprises in abutting connection with connected unit 221 and contiguous connected unit 222, wherein, be used to be communicated with the smooth region that closely links to each other in abutting connection with connected unit 221, the largest connected smooth region that contiguous connected unit 222 is used for to obtain by adjacency connected unit 221 is a benchmark, utilizes next-door neighbour's property principle to select other can be as the smooth region of road candidate region jointly as the road candidate region.
Morphology amending unit 23 is used for carrying out the morphology correction according to the geometry character pair road candidate regions such as area of road.Comprising empty filler cells 231 and zonule rejected unit 232, be respectively applied for cavity and the deletion area less independent smooth region of filling, thereby generate the road area image of determining as the connection smooth region inside of road candidate region.
Be that the invention will be further described for example with vehicle mounted road zone detection system below.
At first, as the onboard image collection device acquisition vehicle front of image acquisition units or the image at rear, then the image that gets access to is inputed to data processing unit.
Then, the present invention utilizes basic level and smooth this feature of road area, and the above-mentioned image that gets access to is carried out piecemeal, adopts the method for compute gradient to weigh its level and smooth degree in the local zonule of piecemeal, obtains smooth region.Need to prove that herein the present invention only does piecemeal to the part below the vanishing line in the image and handles, " vanishing line " be " local horizon " just, promptly only the land image section in the obtaining image is handled.Vanishing line wherein determines that technology is a prior art, under the hypothesis of perspective projection, for a video camera, a series of parallel lines in scene (can simply be interpreted as ground series of parallel line, as lane line) be mapped on the image and intersect at same point for a series of straight lines, this point is called end point.This end point row at place on image is called vanishing line.
Popular, Grad is exactly the place of the marked change of gradation of image value, and the concrete grammar of the local zonule inside gradient of calculating piecemeal is as follows:
Ultimate principle: establish Grad
H(I), Grad
V(I), Grad
45(I), Grad
135(I) represent the Grad of area I on level, vertical, 45 ° and 135 ° of directions respectively, the maximal value of getting them is the gradient of Grad (I) as area I,
Grad(I)=max(Grad
H(I),Grad
V(I),Grad
45(I),Grad
135(I))
The gradient of setting regions I then is smooth region as if satisfying following formula, otherwise is non-smooth region:
Grad(I)<Thre
Wherein, Thre is the threshold value of selecting in advance.For overcoming the influence of false edges such as shade, water mark, threshold value is taken as 0.05.
The concrete computing method of gradient are as follows:
1) image that obtains is divided into several local zonules, each local zonule all is the fritter of a n * n, and wherein n is an integer.
2) calculate the Grad of each local zonule on level, vertical, 45 ° and 135 ° of directions.Fritter with 3 * 3, the Grad on the calculated level direction are example, and shown in Fig. 4 a, three pixels that indicate identical patterns are established I as one group
1, I
2, I
3The average gray value of representing each group respectively,
I wherein
Ij, i=1 ... 3, j=1 ... 3, the gray-scale value of each pixel in the expression fritter.
3) rate of change between three gray-scale values of calculating:
ΔI
12=|I
1-I
2|/max(I
1,I
2)
ΔI
13=|I
1-I
3|/max(I
1,I
3)
ΔI
32=|I
3-I
2|/max(I
3,I
2)
4) horizontal gradient of this zonule, part is three rate of change maximums between the gray-scale value:
Grad
H(I)=max(ΔI
12,ΔI
13,ΔI
32)
Vertically, to get the computing method of the Grad on computing method and the horizontal direction similar for the Grad on 45 ° and the 135 ° of directions, respectively shown in Fig. 4 b, 4c and 4d, to indicate three pixels of identical patterns as one group, calculate the average gray value of each each group of direction, calculate three rate of change between the gray-scale value then, obtain the VG (vertical gradient) of this fritter, 45 ° of gradients and 135 ° of gradients at last.Those skilled in the art can obtain specific algorithm according to the description of the Grad computing method on the horizontal direction of front, therefore repeat no more.
Obtain the gradient G rad (I) of area I then according to the Grad of area I on level, vertical, 45 ° and 135 ° of directions:
Grad(I)=max(Grad
H(I),Grad
V(I),Grad
45(I),Grad
135(I))
If the gradient G rad of this area I (I) less than pre-set threshold Thre, is a smooth region then, otherwise is non-smooth region.
In the 3rd step, after the smooth region that utilizes gradient to obtain,, also need therefrom to filter out the road candidate region according to the proximity relations between each smooth region because there is the smooth region on non-road surface to exist.The key of screening road candidate region is to investigate the proximity between each smooth region.
At first,, the smooth region that closely links to each other is interconnected, become bigger connection smooth region, so just the connection smooth region that image has been divided into several independent, has differed in size according to the connectedness between the smooth region.
Then, be benchmark with the connection smooth region of elemental area maximum, investigate other and be communicated with smooth region and its proximity.Considering the out-of-shape of the connection smooth region of elemental area maximum, get its a δ neighborhood here, is 6 pixels in a preferred embodiment of the invention with the δ value.Promptly determine that at the connection smooth region periphery of elemental area maximum a radius is 6 neighborhood.Investigate the crossing property that remaining is communicated with smooth region and this neighborhood then, as if both overlapping is arranged, then be considered as adjacently, this zone can be used as the road candidate region; Otherwise not as the road candidate region.
The 4th step, how much proterties such as area according to road to carrying out the morphology correction in the road candidate region, obtain the final road zone.Following dual mode is mainly taked in the morphology correction:
1) fill in the cavity, promptly fills the cavity as the connection smooth region inside of road candidate region, and this empty elemental area should be less than pre-set threshold;
2) remove the little smooth region of area, be about to area less than the independent smooth region deletion that preestablishes threshold value.
Relevant above-mentioned threshold value comprises the setting of aforementioned δ neighborhood, can be according to the resolution of processing image, final road zone result's parameters such as degree of accuracy requirement are determined, be set at 20 pixels such as the reference threshold that the cavity is filled, the reference threshold that will remove the little smooth region of area is set at 30 pixels.
At last the road area output of determining is got final product.
Characterize road with the zone and have very strong robustness, so this method is not only applicable to the detection in structured road zone, but also be applicable to the destructuring road, concrete detection method is consistent.
More than used specific case principle of the present invention and embodiment are set forth, the explanation of this embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications is such as the zone detection that the present invention also is applied to the course line, water route etc.Therefore, this description should not be construed as limitation of the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to replacement, improvement etc., all is included in protection scope of the present invention.