Road-center detection method, airborne equipment and storage medium
Technical field
The present invention relates to technical field of image processing more particularly to a kind of road-center detection method, airborne equipment and deposit
Storage media.
Background technique
Currently, taking photo by plane based on unmanned plane is gradually played the part of in people's lives with the development of unmanned air vehicle technique
The more and more important role of person.
But it takes photo by plane when using unmanned plane to road, or driving condition of the vehicle on road is carried out with clapping
When, it is difficult to ensure that road is located at the center for the picture that airborne camera takes, for example, it may be possible to which it is inclined in picture to will appear road
Tiltedly or road does not appear in the situation in picture.
In the prior art, the method for generalling use deep learning carries out Road Detection, and according to the result tune of Road Detection
The shooting angle of whole unmanned plane, but the method real-time of this machine learning is poor.
Summary of the invention
The present invention provides a kind of road-center detection method, airborne equipment and storage medium, for promoting airborne camera
Carry out the real-time of Road Detection.
The present invention provides a kind of road-center detection method, comprising: is saturated according to known road tone characteristics and road
Feature is spent, binary conversion treatment is carried out to the scene image of the road to be detected of acquisition, to obtain the scene image of binaryzation;From institute
Removal non-rice habitats region in the scene image of binaryzation is stated, to obtain the binaryzation scene image comprising road area;To described
Binaryzation scene image comprising road area carries out image block, to obtain multiple images sub-block;According to described multiple images
The centroid feature for the road subregion that sub-block includes carries out lines fitting, obtains the center lines of the road to be detected.
Still optionally further, according to known road tone characteristics and road saturation degree feature, to the scene image into
Row binary conversion treatment, to obtain the scene image of binaryzation, comprising: extract chrominance component image from the scene image and satisfy
With degree component image;According to the road tone characteristics, the pixel grey scale on the chrominance component image is carried out at binaryzation
Reason, obtains the tone images of binaryzation;And according to the road saturation degree feature, on the saturation degree component image
Pixel grey scale carries out binary conversion treatment, obtains the saturation degree image of binaryzation;Tone images to the binaryzation and described two
The saturation degree image of value carries out step-by-step logic and operation, obtains the scene image of the binaryzation.
It is still optionally further described that non-rice habitats region is removed from the scene image of the binaryzation, comprising: described in drafting
The encirclement frame of at least one connected region in the scene image of binaryzation;According to the encirclement frame of at least one connected region
Shape feature and area features filter out the connected region for not meeting roadway characteristic from least one described connected region;It will
The grey scale pixel value of the connected region for not meeting roadway characteristic is set as the corresponding grey scale pixel value in non-rice habitats region.
Still optionally further, according at least one connected region encirclement frame shape feature and area features, from
In at least one described connected region, the connected region for not meeting roadway characteristic is filtered out, comprising: at least one described company
Any connected region in logical region executes following at least one judgement operation: judging the top of the encirclement frame of the connected region
Portion at the top of the scene image of the binaryzation at a distance from and the connected region encirclement frame bottom and the binaryzation
The distance of scene image bottom whether be all larger than the size threshold of setting;Judge the connected region encirclement frame and the company
Whether the area ratio in logical region is within the scope of the area ratio of setting;Judge the length-width ratio of the encirclement frame of the connected region
Whether the length-width ratio threshold value of setting is less than;If the result of at least one judgement operation is to be, the connected region is determined
It is the connected region for not meeting roadway characteristic.
Still optionally further, further includes: denoising is carried out to the scene image of the binaryzation: by the binaryzation
Area is less than the connected region removal of the area threshold of setting in scene image;And/or to the scene image of the binaryzation into
Row holes filling.
Still optionally further, it is quasi- that the centroid feature for the road subregion for including according to described multiple images sub-block carries out lines
It closes, obtains the center lines of the road to be detected, comprising: according to the picture for the road subregion that described multiple images sub-block includes
Element distribution, calculates separately the mass center for the road subregion that described multiple images sub-block includes;Include from described multiple images sub-block
Road subregion mass center in, filter out pixel grey scale at mass center and be greater than the mass center of setting gray threshold as effective matter
The heart;If the quantity of effective mass center is greater than the amount threshold of setting, lines fitting is carried out according to effective mass center, is obtained
The center lines of the road to be detected.
Still optionally further, the pixel distribution for the road subregion for including according to described multiple images sub-block, calculates separately
The mass center for the road subregion that described multiple images sub-block includes, comprising: for any image in described multiple images sub-block
Sub-block, if described image sub-block includes multiple road subregions, respectively according to the pixel distribution of the multiple road subregion,
Calculate separately the mass center of the multiple road subregion;The average value for calculating the mass center of the multiple road subregion, as institute
State the mass center of image subblock.
Still optionally further, lines fitting is carried out according to effective mass center, obtains the center line of the road to be detected
Item, comprising: according to the ordinate of effective mass center, identify effective mass center that ordinate is located in same range;According to institute
The mean place for effective mass center that ordinate is located in same range is stated, lines fitting is carried out, obtains the road to be detected
Center lines.
The present invention also provides a kind of airborne equipments, comprising: memory and processor;Wherein, the memory is for storing
One or more computer instruction;The processor is coupled with the memory, for executing one or more computer
Instruction is to be used for road-center detection method provided by the invention.
The present invention also provides a kind of computer readable storage medium for being stored with computer program, the computer program quilt
It can be realized each step in road-center detection method provided by the invention when execution.
It, can be to road to be detected according to known road tone characteristics and road saturation degree feature in the embodiment of the present invention
Scene image carry out binary conversion treatment, obtain the scene image of binaryzation;Then, it can be removed from the scene image of binaryzation
Non-rice habitats region obtains the binaryzation scene image comprising road area, and to the binaryzation scene image comprising road area
Image block is carried out, multiple images sub-block is obtained;Centroid feature based on the road subregion that multiple images sub-block includes, can be into
Line item is fitted to obtain the center lines of road to be detected.Based on above embodiment, road to be detected can got
After scene image, the center lines of road to be detected are extracted from the scene image of road to be detected, real-time is higher.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the flow diagram for the road-center detection method that an exemplary embodiment of the invention provides;
Fig. 2 a is the flow diagram for the road-center detection method that another exemplary embodiment of the present invention provides;
Fig. 2 b is a kind of signal of the scene image for the binaryzation that an exemplary embodiment of the invention provides;
Fig. 2 c is a kind of signal of the scene image for the binaryzation that another exemplary embodiment of the present invention provides;
Fig. 2 d is the schematic diagram for the multiple images sub-block that an exemplary embodiment of the invention provides;
Fig. 2 e is the schematic diagram for the multiple images sub-block that another exemplary embodiment of the present invention provides;
Fig. 2 f is the schematic diagram for the centroid calculation result that an exemplary embodiment of the invention provides;
Fig. 2 g is the schematic diagram for the lines fitting result that an exemplary embodiment of the invention provides;
Fig. 3 is the structural schematic diagram for the mobile unit that an exemplary embodiment of the invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.Below
It will be described in detail in conjunction with attached drawing.
In the prior art, in unmanned plane field, the method for generalling use deep learning carries out Road Detection, and according to
The shooting angle of the result adjustment unmanned plane of Road Detection, but the method real-time of this machine learning is poor.For this
Technical problem, some exemplary embodiments of the invention provide a solution, are illustrated below with reference to attached drawing.
Fig. 1 is the flow diagram for the road-center detection method that an exemplary embodiment of the invention provides, such as Fig. 1 institute
Show, this method comprises:
Step S101, according to known road tone characteristics and road saturation degree feature, to the road to be detected of acquisition
Scene image carries out binary conversion treatment, to obtain the scene image of binaryzation.
Step S102, non-rice habitats region is removed, from the scene image of binaryzation to obtain the two-value comprising road area
Change scene image.
Step S103, image block is carried out to the binaryzation scene image comprising road area, to obtain multiple images
Block.
Step S104, the centroid feature for the road subregion for including according to multiple images sub-block carries out lines fitting, obtains
The center lines of road to be detected.
In the present embodiment, the process of binary conversion treatment is carried out to the scene image of the road to be detected of acquisition, it is combinable
HSV (Hue, Saturation, Value, tone, saturation degree, lightness) color model is realized.
Wherein, road tone characteristics refer in the corresponding hsv color model of road image that the color of H representation in components is special
Sign, the road tone characteristics characterize the color information of road image.Wherein, road image refers to shoot to road
The image arrived.In general, road tone characteristics are indicated with angular amount.Road saturation degree feature, refers to that road image is corresponding
In hsv color model, the color characteristic of S representation in components.The color of road saturation degree character representation road image is close to light
The degree of spectrum color.The degree of color close to spectrum colour is just higher, and the saturation degree of color is also just higher.
In general, the scene image of road to be detected is the image of RGB (Red, Green, Blue, RGB) color mode.
In the present embodiment, and be not directly based on road to be detected scene image R, G, B color characteristic carry out binary conversion treatment, and
Be binary conversion treatment is carried out based on the scene image of tone and saturation degree feature to road to be detected, it is advantageous that: relative to
For RGB feature, tone and saturation degree feature have more vision intuitive, and then during binary conversion treatment, can be based on
Road tone characteristics and saturation degree feature carry out relatively accurately division operation to road area and non-rice habitats region, so as to attain the Way
The division result in road region and non-rice habitats region is closer to the truth.
In the present embodiment, road tone characteristics and road saturation degree feature, can first pass through in advance to a large amount of road image
It is analyzed to obtain.In some cases, road tone characteristics and road saturation degree feature and illumination when shooting road image
Conditions relevant.Based on this, it can first pass through in advance and the road image shot under different illumination conditions is analyzed, establish illumination
Influence model of the condition to road tone characteristics and road saturation degree feature.Based on this, in the scene for getting road to be detected
It, can be according to the illumination condition for the scene image for shooting road to be detected, in conjunction with the illumination condition pre-established to road when image
The influence model of tone characteristics and road saturation degree feature adjusts the road tone characteristics and road saturation degree feature in real time, with
Optimize the effect for carrying out binary conversion treatment to the scene image, repeats no more.
After obtaining the scene image of binaryzation, non-rice habitats region can be removed from the scene image of binaryzation, is wrapped
Binaryzation scene image containing road area, and image block is carried out to the binaryzation scene image comprising road area.Wherein,
When image block, the binaryzation scene image comprising road area can be divided into the multiple images sub-block of equidimension, it can also root
According to actual demand, it is divided into size not equal multiple images sub-block, the present embodiment is with no restrictions.
It should be appreciated that after the binaryzation scene image comprising road area is divided into multiple images sub-block, road area
By dispersed distribution in different image subblocks, road area for convenience of description, is fallen in the portion in image subblock by the present embodiment
Divide and is known as road subregion.Then, the centroid feature for the road subregion that multiple images sub-block includes can be obtained.Wherein, mass center
Feature, it may include but be not limited to the pixel grey scale value tag at the position feature and mass center of mass center etc..Then, it can be based on multiple
The centroid feature for the road subregion that image subblock includes carries out lines fitting, and the lines that fitting is obtained are as road to be detected
The center lines on road.This scene image to binaryzation carries out piecemeal processing, further according to the centroid feature of each image subblock
The true center lines of the mode for carrying out lines fitting, the lines and road to be detected that enable to fitting to obtain more connect
Closely, and calculation amount can be reduced in the case where guaranteeing the accurate situation of testing result, improves calculating speed.
It, can be to the field of road to be detected according to known road tone characteristics and road saturation degree feature in the present embodiment
Scape image carries out binary conversion treatment, obtains the scene image of binaryzation;Then, it can be gone from the scene image of binaryzation unless road
Road region obtains the binaryzation scene image comprising road area, and carries out to the binaryzation scene image comprising road area
Image block obtains multiple images sub-block;Centroid feature based on the road subregion that multiple images sub-block includes, can carry out line
Item is fitted to obtain the center lines of road to be detected.It, can be in the scene for getting road to be detected based on above embodiment
After image, the center lines of road to be detected are extracted from the scene image of road to be detected, real-time is higher.
In above-mentioned and following each embodiments, the scene image of road to be detected can be shot to obtain by airborne equipment,
The airborne equipment includes camera.For example, the airborne equipment can be realized to be mounted on the aerial device on unmanned plane, the dress of taking photo by plane
It sets including one for shooting the high speed camera of road to be detected.
For convenience of description, the scene image of road to be detected is partially referred to as scene image below, it is subsequent to be related to showing up
In place of scape image, it is thus understood that the scene image of road to be detected.
It should be noted that in above-mentioned or following embodiment of the invention, after obtaining the scene image of binaryzation, also
Further denoising can be carried out by the scene image to binaryzation, to promote the levels of precision of road-center detection.
For example, in some scenes, Gaussian smoothing can be carried out to scene image, be made an uproar with reducing the Gauss of scene image
Sound.
For example, in some scenes, morphological erosion algorithm and expansion algorithm can be used, from the scene image of binaryzation
Remove subtle noise, such as tiny noise spot and short-term section.
In another example in some scenes, the area of each connected region on the scene image of binaryzation can be calculated, and by face
Product is less than the connected region removal of the area threshold of setting.Wherein, the connected region that area is less than to the area threshold of setting is gone
It removes, refers to that the grey scale pixel value that area is less than to the connected region of setting area threshold is set as the pixel ash in non-rice habitats region
Angle value.
For another example in some scenes, holes filling can be carried out to the scene image of binaryzation.Optionally, holes filling
When, unrestrained water completion method can be used and select a seed point first in the scene image of binaryzation, will then be connected with seed point
Region grey scale pixel value be set as hole periphery pixel grey scale pixel value, repeat no more.
Optionally, the present embodiment the scene image of binaryzation can be individually performed above-mentioned each denoising operation, also to two-value
The scene image of change executes above-mentioned all denoising operations, further to promote the accuracy of road-center detection.
Optionally, in some embodiments, according to known road tone characteristics and road saturation degree feature, to acquisition
When the scene image of road to be detected carries out binary conversion treatment, the pixel in scene image can be directly based upon in rgb color mould
Color characteristic under formula carries out binary conversion treatment, will be explained in detail below.
For any pixel point in scene image, the RGB feature of the pixel can extract, the RGB of the picture point is special
Levy tone (H) feature and saturation degree (S) feature being mapped as in HSV colour model.Then, the tone (H) obtained in conjunction with mapping
Feature and saturation degree (S) feature and known road tone characteristics and road saturation degree feature, determination divide the pixel
For road area or non-rice habitats region.After executing aforesaid operations for each pixel in scene image, that is, complete
The operation of binary conversion treatment is carried out to scene image.
It optionally, in further embodiments, can be before carrying out binary conversion treatment to scene image, by rgb color mould
The scene image of formula is converted into the scene image of HSV color mode, and in the scene image based on HSV color mode, each picture
Tone (H) feature and saturation degree (S) feature of vegetarian refreshments and known road tone characteristics and road saturation degree feature, to field
Scape image carries out binary conversion treatment.
The embodiment of above two binary conversion treatment is optional embodiment of the invention, below will be in advance will
The scene image of rgb color mode is converted into for the scene image of HSV color mode, in conjunction with Fig. 2 a, to provided by the invention
Road-center detection method is specifically addressed.
Fig. 2 a is the flow diagram for the road-center detection method that an exemplary embodiment of the invention provides, such as Fig. 2 a institute
Show, this method comprises:
Step S201, the scene image of road to be detected is obtained, and extracts chrominance component image from scene image and satisfies
With degree component image.
Step S202, according to known road tone characteristics, binaryzation is carried out to the pixel grey scale on chrominance component image
Processing, obtains the tone images of binaryzation, and according to known road saturation degree feature, to the pixel on saturation degree component image
Gray scale carries out binary conversion treatment, obtains the saturation degree image of binaryzation.
Step S203, step-by-step logic and operation is carried out to the saturation degree image of the tone images of binaryzation and binaryzation, obtained
To the scene image of binaryzation.
Step S204, the encirclement frame of at least one connected region in the scene image of binaryzation is drawn, and at least according to this
The shape feature and area features of the encirclement frame of one connected region are filtered out and are not met from least one connected region
The connected region of roadway characteristic.
Step S205, it is corresponding to be set as non-rice habitats region for the grey scale pixel value that will not meet the connected region of roadway characteristic
Grey scale pixel value.
Step S206, image block is carried out to the binaryzation scene image comprising road area, to obtain multiple images
Block.
Step S207, the pixel distribution for the road subregion for including according to multiple images sub-block, calculates separately multiple images
The mass center for the road subregion that sub-block includes, and from the mass center for the road subregion that multiple images sub-block includes, screen pledge
Pixel grey scale at the heart is greater than the mass center of setting gray threshold as effective mass center.
Step S208, when the quantity of effective mass center is greater than the amount threshold of setting, it is quasi- that lines are carried out according to effective mass center
It closes, obtains the center lines of road to be detected.
In step S201, optionally, in one case, airborne equipment can shoot frame by frame road to be detected, obtain
To the scene image of multiframe road to be detected, for detecting road-center.In another case, airborne equipment can be to be checked
It surveys road and carries out video capture, obtain video data, and read the scene image of multiframe road to be detected from video data, with
For detecting road-center.
Optionally, in some embodiments, scene image can be carried out at compression before carrying out road-center detection
Reason, reduces the data volume of scene image, to promote the speed of subsequent road-center detection.
In the present embodiment, the scene image of rgb color mode can be converted in advance the scene figure of HSV color mode
Picture.Then, from the scene image of HSV color mode, tone (H) component image and saturation degree component (S) image are extracted.
It, in step 202, can be respectively to tone after obtaining tone (H) component image and saturation degree component (S) image
(H) component image and saturation degree component (S) image are handled.
Optionally, for chrominance component image, it can determine whether the tone value of each pixel on chrominance component image
Whether match with known road tone characteristics, and pixel is divided to by road area or non-rice habitats according to matching result
Region.Optionally, the tone characteristics of road area, the tone value that can behave as the pixel of road area are greater than the tone of setting
Threshold value.
Based on this, it can determine whether the tone value of each pixel on chrominance component image is greater than the tone threshold of setting
Value, if more than the pixel is then divided to road area;If being less than or equal to, which is divided to non-rice habitats
Region.In some embodiments, the grey scale pixel value of road area can be set as 1, the grey scale pixel value in non-rice habitats region is set
It is 0.That is, can be by chrominance component image, the pixel grey scale that tone value is greater than the pixel of the hue threshold of setting is set
It is 1, the pixel grey scale that tone value is less than or equal to the pixel of the hue threshold of setting is set as 0, as shown in formula 1:
Wherein, h (x, y) indicates coordinate is the tone value of the pixel of (x, y), and dH (x, y) indicates coordinate is the picture of (x, y)
The grey scale pixel value of vegetarian refreshments, H0 indicate hue threshold.
Optionally, for saturation degree component image, it can determine whether the full of each pixel on saturation degree component image
Whether match with known road saturation degree feature with degree, and pixel is divided to by road area and non-according to matching result
Road area.Optionally, the saturation degree feature of road area, the saturation degree that can behave as the pixel of road area are greater than setting
Saturation degree threshold value.
Based on this, it can determine whether the saturation degree of each pixel on saturation degree component image is greater than the saturation degree of setting
Threshold value, if more than the pixel is then divided to road area;If being less than or equal to, which is divided to non-road
Road region.In some embodiments, the pixel grey scale of road area can be set as 1, the pixel grey scale in non-rice habitats region is set as
0.Based on this, the pixel grey scale that saturation degree on saturation degree component image can be greater than to the pixel of the saturation degree threshold value of setting is set as
1, the pixel grey scale that intensity value is less than or equal to the pixel of the saturation degree threshold value of setting is set as 0, as shown in formula 2:
Wherein, s (x, y) indicates coordinate is the intensity value of the pixel of (x, y), and dH (x, y) indicates coordinate is (x, y)
The grey scale pixel value of pixel, S0 indicate saturation degree threshold value.
Based on above-mentioned processing, the tone images of binaryzation and the saturation degree image of binaryzation can be obtained, next, executable
The saturation degree image of step S203, tone images and binaryzation to binaryzation carry out step-by-step logic and operation, obtain binaryzation
Scene image.The mode of the step-by-step logic and operation can be as shown in formula 3:
DSH (x, y)=dS (x, y) &dH (x, y) formula 3
Wherein, & indicates "AND" logical operation, and dSH (x, y) indicates that "AND" logical operation recoil is designated as the pixel of (x, y)
Grey scale pixel value.Based on this step-by-step and operation, binaryzation is carried out to scene image in combination with two different characteristics of image,
Be conducive to be promoted the degree of closeness of binarization result and truth.
Next, the encirclement frame of at least one connected region in the scene image of binaryzation can be drawn in step S204.
Wherein, the frame that frame refers to surrounding connected region is surrounded, in general, the encirclement frame can embody the contour feature of connected region.
Optionally, the minimum rectangle that connected region can be drawn in the present embodiment surrounds frame or smallest circular surrounds frame, as connected region
The encirclement frame in domain.
Then, the shape feature and area features of the encirclement frame of at least one connected region are obtained, and at least based on this
The shape feature and area features of the encirclement frame of one connected region are filtered out and are not met from least one connected region
The connected region of roadway characteristic.
In some scenes, such as to road vehicle it carries out under track up scene, airborne equipment is generally along road
The extending direction on road shoots road to be detected.So, in the scene image taken, meet the connected region of roadway characteristic
Domain, which should show the shape feature that road has and road, has extensibility, continuity and systematicness feature.Based on this,
Judge whether each connected region meets above-mentioned roadway characteristic one by one, can determine which is connected to from least one connected region
Region is located in road area.
Optionally, in the present embodiment, for any connected region at least one connected region, judge the connection
When whether region meets roadway characteristic, following at least one judgement operation can be performed:
First, the top of the encirclement frame of calculating connected region distance H1, Yi Jilian at the top of the scene image of binaryzation
The bottom of the encirclement frame in logical region and the scene image bottom distance H2 of binaryzation, as shown in Fig. 2 b and Fig. 2 c.Next, it is determined that
Whether H1 and H2 is all larger than the size threshold Ht of setting.
When airborne equipment is shot along road extending direction, in a case where, road is not turned.This
Under situation, since road is with certain continuity, in the scene image that airborne equipment takes, the top of road area is usual
Concordant with the top of scene image, the bottom of road area is usually concordant with the bottom of scene image.Therefore, for meeting road
For the connected region of feature, surround frame top at the top of the scene image of binaryzation at a distance from be less than or equal to setting
Size threshold, and its surround frame bottom at a distance from the scene image bottom of binaryzation again smaller than or equal to the size threshold of setting
Value.Optionally, distance described in the present embodiment, refers to minimum range.
A kind of road area that do not turn typically is as shown in Figure 2 b, in figure 2b, the top of the encirclement frame of road area
Intersect with having at the top of the scene image of binaryzation, that is to say, that surround the minimum at the top of the top of frame and the scene image of binaryzation
Distance is 0;The bottom of encirclement frame and the scene image bottom of binaryzation of road area, which have, to intersect, that is to say, that surrounds the bottom of frame
The minimum range of portion and the scene image bottom of binaryzation is 0.
It, may in the scene image that airborne equipment takes when in another case, when road is turned the case where
There is following situation: it is concordant with the top of scene image at the top of road area, but the bottom of road area and scene image
Bottom distance relatively far apart;Alternatively, the top of road area and the top of scene image relatively far apart at a distance from, but road
The bottom in road region and the bottom of scene image are concordant.In this case, for the connected region for meeting roadway characteristic,
Its surround frame top at the top of the scene image of binaryzation at a distance from be less than or equal to setting size threshold or its encirclement
The bottom of frame meets one i.e. again smaller than or equal to the size threshold of setting, the two at a distance from the scene image bottom of binaryzation
It can.
A kind of typical road area that there is turning is as shown in Figure 2 c, in figure 2 c, the top of the encirclement frame of road area
There are a certain distance, the bottom of the encirclement frame of road area and the scene figures of binaryzation at the top of the scene image of portion and binaryzation
As intersection is arranged at bottom, that is to say, that the minimum range for surrounding the bottom of frame and the scene image bottom of binaryzation is 0.
Based on it is above-mentioned it is found that when connected region encirclement frame top at the top of the scene image of binaryzation distance H1,
And the bottom of the encirclement frame of connected region is all larger than the size threshold of setting with the scene image bottom distance H2 of binaryzation
When Ht, it may be determined that the connected region is unsatisfactory for the continuity requirement of road.
Second, judging the area ratio for surrounding frame and connected region of connected region whether not in the area ratio model of setting
In enclosing.
It should be appreciated that usual road has more regular shape, the area of the encirclement frame for the road area drawn
It should be closer to the area of road area, as shown in figs. 2 b and 2 c.Based on this, the area S1 of the connected region can be calculated, and
After the encirclement frame for drawing the connected region, the area S2 for surrounding frame is calculated.Then, and the ratio of S2 and S1 is calculated, and sentenced
Whether the ratio of disconnected S2 and S1 is within the scope of the area ratio of setting, as shown in formula 4:
Wherein, S2 can be calculated according to the length and width for surrounding frame, VminAnd VmaxRefer to the area ratio of setting
The lower and upper limit value of range.In the present embodiment, length refers to surrounding the size of the long side of frame, and width refers to surrounding frame
Short side size, it is subsequent to repeat no more.
If the ratio of S2 and S1 not within the scope of the area ratio of setting, can determine that the connected region does not meet road tool
The systematicness feature of some shape features and road.
Third, judging whether the length-width ratio of the encirclement frame of connected region is less than the length-width ratio threshold value of setting.
In general, road has extensibility and continuity, when airborne equipment shoots road along road extending direction, due to machine
The camera site for carrying equipment is higher, then in the scene image taken, the length of road area should be greater than the width of road area
Degree, as shown in figures 2 a and 2b.Based on this, in this step, the length and width for surrounding frame can be calculated after the encirclement frame for drawing connected region
Than, and judge whether the length-width ratio for surrounding frame is less than the length-width ratio threshold value of setting, if being less than, it is believed that the connected region does not have
There are extensibility and continuity.
Certainly, above-mentioned three kinds of judgements operate only for illustration, in fact, can also be judged by other features
Whether connected region meets roadway characteristic, repeats no more.It should be noted that in embodiments of the present invention, can it is above-mentioned at least
In the case that one kind is judged as YES, determine that the connected region does not meet roadway characteristic.It preferably, in some embodiments, can be
The result of above-mentioned three kinds of judgements operation is to determine that the connected region does not meet roadway characteristic, in the case where being to avoid final
There are relatively large deviations with real roads center lines for the lines that fitting obtains.
After filtering out and not meeting the connected region of roadway characteristic, step S205 can be performed, roadway characteristic will not met
Connected region grey scale pixel value, be set as the corresponding grey scale pixel value in non-rice habitats region.
Then, step S206 is executed, image block is carried out to the binaryzation scene image comprising road area, it is more to obtain
A image subblock, as shown in Figure 2 d.
In the present embodiment, the line number N of image subblock can be selected based on experience valuecolWith columns Nrow.Wherein, image subblock
Line number NcolSelection require can be with are as follows: while so that the obtained lines of fitting are more smooth, expend the less time at
This.The columns N of image subblockrowSelection require can be with are as follows: so that the lines that fitting obtains are closer to the center of road to be detected
While lines, less time cost is expended.
After obtaining multiple images sub-block, step S207, the road sub-district for including according to multiple images sub-block can be performed
The pixel distribution in domain calculates separately the mass center for the road subregion that multiple images sub-block includes, and includes from multiple images sub-block
Road subregion mass center in, filter out pixel grey scale at mass center and be greater than the mass center of setting gray threshold as effective matter
The heart.
In the present embodiment, for any image sub-block in multiple images sub-block, calculating the image subblock includes
Road subregion mass center when, the pixel grey scale value matrix of road subregion can be obtained, in advance to obtain in the image subblock
The pixel distribution of road subregion, then calculate based on the pixel grey scale value matrix mass center of the road subregion.
Optionally, judge the road subregion that a certain image subblock includes mass center whether be effective mass center a kind of mode
Are as follows: judge whether the pixel grey scale at the mass center of the road subregion is greater than setting gray threshold, if it has, then determining the road
The mass center of subregion is effective mass center.Wherein, the gray threshold set is empirical value, and the present embodiment is with no restrictions.
In one case, as shown in Figure 2 e, in multiple images sub-block, it is understood that there may be certain image subblocks include multiple roads
The case where way region.It in this case, optionally, can be according to the picture for the multiple road subregions for including in the image subblock
Element distribution, calculates separately the mass center of multiple road subregion;Then, being averaged for the mass center of multiple road subregion is calculated
Value, the mass center as the image subblock.As shown in Figure 2 e, when in image subblock A0 include two roads subregion A01 and A02,
The mass center A01 (x1, y1) and A02 (x2, y2) of road subregion A01 and A02 can be calculated separately, and by [(x1+x2)/2, (y1+
Y2)/2] mass center as image subblock A0.
Optionally, in step S208, after the effective mass center of determination, it can determine whether the quantity of effective mass center is greater than setting
Amount threshold, if more than, then can according to effective mass center carry out lines fitting, obtain the center lines of road to be detected.
Wherein, as empirical value, which can be configured the amount threshold set according to the quantity of image subblock.Optionally,
In some embodiments, the settable amount threshold is [Ncol*Nrow/ 3], wherein Ncol*NrowFor the quantity of image subblock, []
Indicate round numbers operation.For example, the settable amount threshold is 3, when image subblock when the quantity of image subblock is 10
When quantity is 20, the settable amount threshold is 6.Certainly, in practice, may also set up the amount threshold is [Ncol*Nrow/
4] or [Ncol*Nrow/ 5], the present embodiment is with no restrictions.
Optionally, when carrying out straight line fitting according to effective mass center, vertical seat can be identified according to the ordinate of effective mass center
Mark is in effective mass center in same range.Wherein, ordinate is located at effective mass center in same range, refers to effective mass center
Corresponding image subblock is located at same a line.As shown in figure 2f, effective mass center A01, B01, C01 are that ordinate is located in same range
Effective mass center, effective mass center A11, B11, C11 be ordinate be located at effective mass center in same range, effective mass center A21,
B21, C21, D21 are that ordinate is located at effective mass center in same range.Then, it calculates ordinate and is located at having in same range
The mean place for imitating mass center, obtains multiple mean places that ordinate is located in different range.Above-mentioned example is accepted, this step can
Obtain the mean place P0 of effective mass center A01, B01, C01, the mean place P1 of effective mass center A11, B11, C11 and effectively
The mean place P2 of mass center A21, B21, C21, D21, as shown in Figure 2 g.Then, line can be carried out based on mean place P0, P1, P2
Item fitting, obtains the center lines of road to be detected.
It, can be to the field of road to be detected according to known road tone characteristics and road saturation degree feature in the present embodiment
Scape image carries out binary conversion treatment, obtains the scene image of binaryzation;Then, it can be gone from the scene image of binaryzation unless road
Road region obtains the binaryzation scene image comprising road area, and carries out to the binaryzation scene image comprising road area
Image block obtains multiple images sub-block;Centroid feature based on the road subregion that multiple images sub-block includes, can carry out line
Item is fitted to obtain the center lines of road to be detected.It, can be in the scene for getting road to be detected based on above embodiment
After image, the center lines of road to be detected are extracted from the scene image of road to be detected, real-time is higher.Except this it
Outside, the centroid feature for the road subregion for including based on multiple images sub-block carries out the mode of lines fitting, can count reducing
While calculation amount, the accuracy of road-center detection is effectively promoted.
It should be noted that the executing subject of each step of above-described embodiment institute providing method may each be same equipment,
Alternatively, this method is also by distinct device as executing subject.For example, the executing subject of step 201 to step 204 can be equipment
A;For another example, step 201 and 202 executing subject can be equipment A, the executing subject of step 203 can be equipment B;Etc..
In addition, containing in some processes of the description in above-described embodiment and attached drawing according to particular order appearance
Multiple operations, but it should be clearly understood that these operations can not execute or parallel according to its sequence what appears in this article
It executes, serial number of operation such as 201,202 etc. is only used for distinguishing each different operation, and serial number itself does not represent any
Execute sequence.In addition, these processes may include more or fewer operations, and these operations can execute in order or
It is parallel to execute.
Above embodiments describe the optional embodiment of road-center detection method provided by the invention, and this method can be by
Airborne equipment shown in Fig. 3 realizes that optionally, which includes: memory 301 and processor 302.
Memory 301 for storing one or more computer instruction, and can be configured to store various other data with
Support the operation on airborne equipment.The example of these data include any application program for being operated on airborne equipment or
The instruction of method.
Memory 301 can realize by any kind of volatibility or non-volatile memory device or their combination,
Such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable is read-only
Memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk
Or CD.
In some embodiments, it includes the memory remotely located relative to processor 302 that memory 301 is optional, these
Remote memory can pass through network connection to airborne equipment.The example of above-mentioned network includes but is not limited to internet, in enterprise
Portion's net, local area network, mobile radio communication and combinations thereof.
Processor 302 is coupled with memory 301, for executing one or more computer instruction to be used for: according to
The road tone characteristics and road saturation degree feature known carry out binary conversion treatment to the scene image of the road to be detected of acquisition,
To obtain the scene image of binaryzation;Non-rice habitats region is removed, from the scene image of the binaryzation to obtain comprising roadway area
The binaryzation scene image in domain;Image block is carried out to the binaryzation scene image that this includes road area, to obtain multiple figures
As sub-block;The centroid feature for the road subregion for including according to multiple image subblock carries out lines fitting, and it is to be detected to obtain this
The center lines of road.
Still optionally further, processor 302 is according to known road tone characteristics and road saturation degree feature, to this
Scape image carries out binary conversion treatment and is specifically used for when obtaining the scene image of binaryzation: extracting tone from the scene image
Component image and saturation degree component image;According to the road tone characteristics, the pixel grey scale on the chrominance component image is carried out
Binary conversion treatment obtains the tone images of binaryzation;And according to the road saturation degree feature, to the saturation degree component image
On pixel grey scale carry out binary conversion treatment, obtain the saturation degree image of binaryzation;To the tone images of the binaryzation and this two
The saturation degree image of value carries out step-by-step logic and operation, obtains the scene image of the binaryzation.
Still optionally further, it is specific to use when processor 302 removes non-rice habitats region in the scene image from the binaryzation
In: the encirclement frame of at least one connected region in the scene image for drawing the binaryzation;According at least one connected region
The shape feature and area features for surrounding frame filter out the connection for not meeting roadway characteristic from least one connected region
Region;By the grey scale pixel value of the connected region for not meeting roadway characteristic, it is set as the corresponding pixel grey scale in non-rice habitats region
Value.
Still optionally further, processor 302 is according to the shape feature for surrounding frame of at least one connected region and face
Product feature when filtering out the connected region for not meeting roadway characteristic, is specifically used for: being directed to from least one connected region
Any connected region at least one connected region executes following at least one judgement operation: judging the connected region
Surround frame top with the scene image of the binaryzation at the top of at a distance from and the connected region encirclement frame bottom with this two
Whether the distance of the scene image bottom of value is all larger than the size threshold of setting;
Judge the area ratio for surrounding frame and the connected region of the connected region whether not in the area ratio model of setting
In enclosing;Judge whether the length-width ratio of the encirclement frame of the connected region is less than the length-width ratio threshold value of setting;If at least one judges
The result of operation is to be, determines that the connected region is not meet the connected region of roadway characteristic.
Still optionally further, processor 302 is also used to: denoising is carried out to the scene image of the binaryzation: by this two
Area is less than the connected region removal of the area threshold of setting in the scene image of value;And/or the scene figure to the binaryzation
As carrying out holes filling.
Still optionally further, centroid feature of the processor 302 in the road subregion for including according to multiple image subblock
It carries out lines fitting to be specifically used for when obtaining the center lines of the road to be detected: the road for including according to multiple image subblock
The pixel distribution in way region calculates separately the mass center for the road subregion that multiple image subblock includes;From multiple image
In the mass center for the road subregion that sub-block includes, the mass center conduct that the pixel grey scale at mass center is greater than setting gray threshold is filtered out
Effective mass center;If the quantity of effective mass center is greater than the amount threshold of setting, lines fitting is carried out according to effective mass center, is obtained
To the center lines of the road to be detected.
Still optionally further, processor 302 the road subregion for including according to multiple image subblock pixel distribution,
When calculating separately the mass center for the road subregion that multiple image subblock includes, it is specifically used for: in multiple image subblock
Any image sub-block, if the image subblock include multiple road subregions, respectively according to the picture of multiple road subregion
Element distribution, calculates separately the mass center of multiple road subregion;The average value for calculating the mass center of multiple road subregion, as
The mass center of the image subblock.
Still optionally further, processor 302 is carrying out lines fitting according to effective mass center, obtains the road to be detected
When the lines of center, it is specifically used for: according to the ordinate of effective mass center, identifies effective matter that ordinate is located in same range
The heart;It is located at the mean place of effective mass center in same range according to the ordinate, carries out lines fitting, obtain the road to be detected
The center lines on road.
Still optionally further, as shown in figure 3, the airborne equipment further include: input unit 303 and output device 304.Its
In, input unit 303 can receive the number or character information of input, and generate the user setting and function with airborne equipment
Related key signals input is controlled, such as input unit 303 may include the camera for acquiring road image to be detected.Output
Device 304 may include that display screen etc. shows equipment.
Further, as shown in figure 3, the airborne equipment further include: power supply module 305.Power supply module 305 is power supply module
The various assemblies of place equipment provide electric power.Power supply module may include power-supply management system, one or more power supplys and other
The associated component of electric power is generated, managed, and distributed with for equipment where power supply module.
As shown in figure 3, memory 301, processor 302, input unit 303, output device 304 and power supply module 305
It can be connected by bus or other modes, in figure by taking bus connects as an example.In the connection type that other are not illustrated, deposit
Reservoir 301 can directly be of coupled connections with processor 302, and input unit 303 and output device 304 can pass through data line and data
Interface is directly or indirectly connect with processor 302.Certainly, above-mentioned connection type is only for illustration, real to the present invention
The protection scope for applying example is not limited in any way.
Road-center detection method provided by the embodiment of the present application can be performed in above-mentioned airborne equipment, has execution method phase
The functional module and beneficial effect answered.The not technical detail of detailed description in the present embodiment, reference can be made to the embodiment of the present application institute
The method of offer, repeats no more.
The present invention also provides a kind of computer readable storage medium for being stored with computer program, which is held
It can be realized the step in the method that above-mentioned airborne equipment is able to carry out when row.
Apparatus embodiments described above are merely indicative, wherein described unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.