CN109740532A - A kind of Path Recognition and middle line optimization method based on annulus road - Google Patents

A kind of Path Recognition and middle line optimization method based on annulus road Download PDF

Info

Publication number
CN109740532A
CN109740532A CN201811653805.0A CN201811653805A CN109740532A CN 109740532 A CN109740532 A CN 109740532A CN 201811653805 A CN201811653805 A CN 201811653805A CN 109740532 A CN109740532 A CN 109740532A
Authority
CN
China
Prior art keywords
road
point
line
sideline
annulus
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.)
Pending
Application number
CN201811653805.0A
Other languages
Chinese (zh)
Inventor
陈明华
蔡昌春
王海滨
罗成名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hohai University Changzhou Campus
Original Assignee
Hohai University Changzhou Campus
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hohai University Changzhou Campus filed Critical Hohai University Changzhou Campus
Priority to CN201811653805.0A priority Critical patent/CN109740532A/en
Publication of CN109740532A publication Critical patent/CN109740532A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of Path Recognition based on annulus road and middle line optimization methods, include the following steps: step S1, obtain the gray level image of annulus road;Step S2 chooses optimal threshold using Otsu algorithm, obtains best pixel point and be 0xff or be the binary image of 0x00;Step S3 determines image highway sideline using edge hunting method to binary image;Step S4 extracts the sideline feature of road in binary image, determines whether annulus, if annulus, is then optimized to sideline using once linear interpolation method, the secondary sideline after being optimized, to obtain first time road axis;Step S5 optimizes first time road axis, obtains second of road axis, i.e., final road axis.The present invention carries out identification comparison to annulus road image feature, can accurately identify annulus road, and the road Path Recognition of precise and high efficiency has far-reaching significance unpiloted development in this method.

Description

A kind of Path Recognition and middle line optimization method based on annulus road
Technical field
The invention belongs to mode identification technologies, and in particular to a kind of Path Recognition and middle line based on annulus road are excellent Change method.
Background technique
In recent years, unmanned by social institute's extensive concern.In unmanned, the Path Recognition of road is one again A very important part.And in the prior art when passing through annulus road during unmanned due to the deficiency of algorithm, nothing People drives and is easy to judge that traffic accident occurs in inaccuracy due to road conditions, in the image based on Path Recognition, needs pair Mass data is calculated and is analyzed.
Summary of the invention
It is an object of the invention to overcome the deficiencies of the prior art and provide a kind of Path Recognition based on annulus road and Middle line optimization method is capable of the identification annulus of precise and high efficiency and is optimized to center line, to obtain better center line Diameter.
In order to solve the above technical problems, the present invention provides a kind of Path Recognition based on annulus road and middle line optimization sides Method, characterized in that include the following steps:
Step S1 obtains the gray level image of annulus road;
Step S2 chooses optimal threshold using Otsu algorithm, obtains best pixel point and be 0xff or be the two-value of 0x00 Change image;
Step S3 determines road image sideline using edge hunting method to binary image;
Step S4 extracts the sideline feature of road in binary image, determines whether road is annulus, if annulus, then Highway sideline is optimized using once linear interpolation method, the secondary highway sideline after being optimized, to obtain first time road Center line;
Step S5 optimizes first time road axis, second of road axis of acquisition, i.e., in final road Heart line.
Further, the process of optimal threshold is chosen in step s 2 are as follows:
Note M=256 single channel tonal gradation, Sum=sum of all pixels,
Background pixel accountingWherein N1For background pixel number;
Foreground pixel accountingIn formula, N2For preceding pixel number;
The average gray value of background
In formula, PiFor probability, C1For pixel background;
The average gray value of prospect
In formula, PiFor probability, C2For pixel prospect;
It can to sum up obtain, the gray scale accumulated value u=u of 0-M gray scale interval11+u22,
Then inter-class variance
G=ω1*(u-u1)22*(u-u2)212*(u1-u2)2,
Take inter-class variance g maximum, gray value at this time is optimal threshold.
Preferentially, the process in road image sideline is determined with edge hunting method in step s3 are as follows:
Since the d row of the binary image of road, initial d=1, from the left edge of entire binary image in Between the jump that successively determines whether 0xff to 0x00 occur if having will indicate the d of the binary image of the road found Capable sideline trip point is considered as the starting point of left side bearing, is denoted as a1;Successively from the right hand edge of entire binary image to centre The jump for determining whether 0xff to 0x00 occur jumps the sideline of the d row of the binary image of the road found if having Height is considered as the starting point of right side bearing, is denoted as b1;If failing in the d row of the binary image of road finds a1,b1, Then the d line number value of the binary image of road increases by 1 i.e. d=d+1, by the left edge of the d row of the binary image of road The jump for successively determining whether 0xff to 0x00 occur to centre respectively with right hand edge repeats this step until finding a1,b1
Setting range x, in a1The trip point that next line is looked within the scope of ± x is denoted as a2, then in a2It is sought in the range of ± x The trip point of next line is looked for be denoted as a3, and so in anUntil finding all trip point a in ± xn, n is positive integer, is owned Trip point anLine is left side bearing;In b1The trip point that next line is looked within the scope of ± x is denoted as b2, then in b2The model of ± x It encloses the interior trip point for finding next line and is denoted as b3, and so on until in all bnAll trip point b are found in ± xn, n is Positive integer, all trip point bnLine is right side bearing, and the coordinate of the i-th left side bearing of note is (i, Li), remember the seat of the i-th right side bearing It is designated as (i, Ri);
After obtaining all sidelines, left side bearing and right side bearing are optimized, if certain a line left side bearing exists and phase The edge-stitching point ordinate of adjacent two row left side bearings is apart greater than definite value e, then is considered as the row sideline and noise occur, take the row side at this time The adjacent rows left side bearing point ordinate average value of line is as the row sideline point, as road image left side bearing;If certain a line Right side bearing, which exists, is apart greater than definite value e with the edge-stitching point ordinate of adjacent rows right side bearing, then is considered as the row sideline and makes an uproar Point, takes the adjacent rows right side bearing point ordinate average value in the row sideline as the row sideline point at this time, and as road image is right Sideline.
Preferentially, determining the process of annulus in step s 4 is:
Process 1 takes the sideline of the lower half portion of binary image in step S3, and the coordinate in all sidelines is averaged To a line segment;The slope of a line segment is obtained by common least square method, extends to obtain by a line segment according to this slope One new straight line, coordinate are denoted as (i, Mi), using new straight line as annulus Preliminary Identification line, this identification line needs to meet:
Li< Mi< Ri
It is considered as if the pixel jump that adjacent rows occurs in identification line and finds annulus, remembers that the point is Ring;
Process 2 arranges to scanning by edge hunting method on the basis of finding point Ring and obtains a new edge line, Note coordinate is (Yj), when ordinate is maximized, recording the point is R (Ymax,jmax), the sideline feature is examined, if the side Line meets condition:
Then it is determined as annulus;
Process 3 is then needed to optimize processing to the highway sideline part of annulus, be found respectively if being determined as annulus The inflection point A of the whole image road left side bearing and inflection point B of right side bearing, inflection point A and inflection point B, that is, left side bearing are without extreme point and right side bearing Without extreme point, if the left side bearing and right side bearing in whole image road find multiple no extreme points respectively, left and right sideline is taken most Two of close ring part are respectively seen as inflection point A and inflection point B without extreme point;Inflection point A and 2 midpoint R of process is utilized into primary line Property interpolation method be connected to new sideline, not connected sideline is constant, similarly tie point B and point R, two secondary sides after being optimized Line, and then obtain first time road axis.
Process 4 mends line process and repeats the above process 3 at annulus outlet.
Preferentially, inflection point A, inflection point B and the process of the point R in process 2 are connected in process 3 is:
If A (x1,y1), R (Ymax,jmax), interpolation point (x, y), then interpolation algorithm are as follows:
Similarly connection inflection point B and point R
Preferentially, in step s 5, road axis is optimized by common least square method, and final road axis is Calculation formula are as follows:
Preferentially, the part of the adjacent left and right sides road where sideline, that is, camera of the lower half portion of binary image Image takes and is equal to the highly long part of image 1/4.
The utility model has the advantages that
The present invention is identified and is compared to annulus road image feature, can accurately identify annulus road, solve nobody The problem of annulus road is multiple accident point in driving procedure, the road Path Recognition of the method for the present invention precise and high efficiency drives nobody The development sailed has far-reaching significance, and has made contribution outstanding to this unmanned technical field;The present invention is using primary Linear interpolation algorithm carries out secondary treatment to annulus road image sideline, effectively optimizes median path.
Detailed description of the invention
Fig. 1 is flow chart of the invention.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.Following embodiment is only used for clearly illustrating the present invention Technical solution, and not intended to limit the protection scope of the present invention.
The present invention is based on binary image, a kind of Path Recognition based on annulus road and middle line optimization method are provided, It is characterized in that including the following steps:
Step S1 obtains the gray level image of annulus road;
Step S2 chooses optimal threshold using Otsu algorithm, obtains best pixel point and be 0xff or be the two-value of 0x00 Change image;
Step S3 determines road image sideline using edge hunting method to binary image;
Step S4 extracts the sideline feature of road in binary image, determines whether road is annulus, if annulus, then Highway sideline is optimized using once linear interpolation method, the secondary highway sideline after being optimized, to obtain first time road Center line;
Step S5 optimizes first time road axis, second of road axis of acquisition, i.e., in final road Heart line.
Further, the process of optimal threshold is chosen in step s 2 are as follows:
Note M=256 single channel tonal gradation, Sum=sum of all pixels,
Background pixel accountingWherein N1For background pixel number;
Foreground pixel accountingIn formula, N2For preceding pixel number;
The average gray value of background
In formula, PiFor probability, C1For pixel background;
The average gray value of prospect
In formula, PiFor probability, C2For pixel prospect;
It can to sum up obtain, the gray scale accumulated value u=u of 0-M gray scale interval11+u22,
Then inter-class variance
G=ω1*(u-u1)22*(u-u2)212*(u1-u2)2,
Take inter-class variance g maximum, gray value at this time is optimal threshold.
Further, the process in road image sideline is determined with edge hunting method in step s3 are as follows:
Since the d row of the binary image of road, initial d=1, from the left edge of entire binary image in Between the jump that successively determines whether 0xff to 0x00 occur if having will indicate the d of the binary image of the road found Capable sideline trip point is considered as the starting point of left side bearing, is denoted as a1;Successively from the right hand edge of entire binary image to centre The jump for determining whether 0xff to 0x00 occur jumps the sideline of the d row of the binary image of the road found if having Height is considered as the starting point of right side bearing, is denoted as b1;If failing in the d row of the binary image of road finds a1, b1, Then the d line number value of the binary image of road increases by 1 i.e. d=d+1, by the left edge of the d row of the binary image of road The jump for successively determining whether 0xff to 0x00 occur to centre respectively with right hand edge repeats this step until finding a1,b1;
Setting range x, in a1The trip point that next line is looked within the scope of ± x is denoted as a2, then in a2It is sought in the range of ± x The trip point of next line is looked for be denoted as a3, and so in anUntil finding all trip point a in ± xn, n is positive integer, is owned Trip point anLine is left side bearing;In b1The trip point that next line is looked within the scope of ± x is denoted as b2, then in b2The model of ± x It encloses the interior trip point for finding next line and is denoted as b3, and so on until in all bnAll trip point b are found in ± xn, n is Positive integer, all trip point bnLine is right side bearing, and the coordinate of the i-th left side bearing of note is (i, Li), remember the seat of the i-th right side bearing It is designated as (i, Ri);
After obtaining all sidelines, left side bearing and right side bearing are optimized, if certain a line left side bearing exists and phase The edge-stitching point ordinate of adjacent two row left side bearings is apart greater than definite value e, then is considered as the row sideline and noise occur, take the row side at this time The adjacent rows left side bearing point ordinate average value of line is as the row sideline point, as road image left side bearing;If certain a line Right side bearing, which exists, is apart greater than definite value e with the edge-stitching point ordinate of adjacent rows right side bearing, then is considered as the row sideline and makes an uproar Point, takes the adjacent rows right side bearing point ordinate average value in the row sideline as the row sideline point at this time, and as road image is right Sideline.
Further, determining the process of annulus in step s 4 is:
Process 1 takes the sideline of the lower half portion of binary image in step S3, and the coordinate in all sidelines is averaged To a line segment;The slope of a line segment is obtained by common least square method, extends to obtain by a line segment according to this slope One new straight line, coordinate are denoted as (i, Mi), using new straight line as annulus Preliminary Identification line, this identification line needs to meet:
Li< Mi< Ri
It is considered as if the pixel jump that adjacent rows occurs in identification line and finds annulus, remembers that the point is Ring;
Process 2 arranges to scanning by edge hunting method on the basis of finding point Ring and obtains a new edge line, Note coordinate is (Yj), when ordinate is maximized, recording the point is R (Ymax,jmax), the sideline feature is examined, if the side Line meets condition:
Then it is determined as annulus;
Process 3 is then needed to optimize processing to the highway sideline part of annulus, be found respectively if being determined as annulus The inflection point A of the whole image road left side bearing and inflection point B of right side bearing, inflection point A and inflection point B, that is, left side bearing are without extreme point and right side bearing Without extreme point, if the left side bearing and right side bearing in whole image road find multiple no extreme points respectively, left and right sideline is taken most Two of close ring part are respectively seen as inflection point A and inflection point B without extreme point;Inflection point A and 2 midpoint R of process is utilized into primary line Property interpolation method be connected to new sideline, not connected sideline is constant, similarly tie point B and point R, two secondary sides after being optimized Line, and then obtain first time road axis.
Process 4 mends line process and repeats the above process 3 at annulus outlet.
Further, inflection point A, inflection point B and the process of the point R in process 2 are connected in process 3 is:
If A (x1,y1), R (Ymax,jmax), interpolation point (x, y), then interpolation algorithm are as follows:
Similarly connection inflection point B and point R
Further, in step s 5, road axis is optimized by common least square method, final road axis For calculation formula are as follows:
Further, the portion of the adjacent left and right sides road where sideline, that is, camera of the lower half portion of binary image Partial image takes and is equal to the highly long part of image 1/4.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, without departing from the technical principles of the invention, several improvement and deformations can also be made, these improvement and deformations Also it should be regarded as protection scope of the present invention.

Claims (7)

1. a kind of Path Recognition and middle line optimization method based on annulus road, characterized in that include the following steps:
Step S1 obtains the gray level image of annulus road;
Step S2 chooses optimal threshold using Otsu algorithm, obtains best pixel point and be 0xff or be the binary picture of 0x00 Picture;
Step S3 determines road image sideline using edge hunting method to binary image;
Step S4 extracts the sideline feature of road in binary image, determines whether road is annulus, if annulus, the road Ze Dui Kerb line is optimized using once linear interpolation method, the secondary highway sideline after being optimized, to obtain first time road-center Line;
Step S5 optimizes first time road axis, obtains second of road axis, i.e., final road-center Line.
2. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 1, characterized in that The process of optimal threshold is chosen in step S2 are as follows:
Note M=256 single channel tonal gradation, Sum=sum of all pixels,
Background pixel accountingWherein N1For background pixel number;
Foreground pixel accountingIn formula, N2For preceding pixel number;
The average gray value of background
In formula, PiFor probability, C1For pixel background;
The average gray value of prospect
In formula, PiFor probability, C2For pixel prospect;
It can to sum up obtain, the gray scale accumulated value u=u of 0-M gray scale interval11+u22,
Then inter-class variance
G=ω1*(u-u1)22*(u-u2)212*(u1-u2)2,
Take inter-class variance g maximum, gray value at this time is optimal threshold.
3. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 1, characterized in that The process in road image sideline is determined in step S3 with edge hunting method are as follows:
Since the d row of the binary image of road, initial d=1, from the left edge of entire binary image to centre according to The secondary jump for determining whether 0xff to 0x00 occur will indicate the d row of the binary image of the road found if having Sideline trip point is considered as the starting point of left side bearing, is denoted as a1;Successively determined from the right hand edge of entire binary image to centre Whether the jump of 0xff to 0x00 is occurred, if having, by the sideline trip point of the d row of the binary image of the road found It is considered as the starting point of right side bearing, is denoted as b1;If failing in the d row of the binary image of road finds a1,b1, then road The d line number value of the binary image on road increases by 1 i.e. d=d+1, left edge and the right side by the d row of the binary image of road The jump that edge successively determines whether 0xff to 0x00 occur to centre respectively repeats this step until finding a1,b1
Setting range x, in a1The trip point that next line is looked within the scope of ± x is denoted as a2, then in a2Under being found in the range of ± x The trip point of a line is denoted as a3, and so in anUntil finding all trip point a in ± xn, n is positive integer, all jumps Height anLine is left side bearing;In b1The trip point that next line is looked within the scope of ± x is denoted as b2, then in b2In the range of ± x The trip point for finding next line is denoted as b3, and so on until in all bnAll trip point b are found in ± xn, n is positive whole Number, all trip point bnLine is right side bearing, and the coordinate of the i-th left side bearing of note is (i, Li), the coordinate of the i-th right side bearing of note is (i,Ri);
After obtaining all sidelines, left side bearing and right side bearing are optimized, if certain a line left side bearing exists and adjacent two The edge-stitching point ordinate of row left side bearing is apart greater than definite value e, then is considered as the row sideline and noise occur, take the row sideline at this time Adjacent rows left side bearing point ordinate average value is as the row sideline point, as road image left side bearing;If on the right of certain a line Line, which exists, is apart greater than definite value e with the edge-stitching point ordinate of adjacent rows right side bearing, then is considered as the row sideline and noise occur, this When take the adjacent rows right side bearing point ordinate average value in the row sideline as the row sideline point, as road image right side bearing.
4. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 3, characterized in that The process of annulus is determined in step S4 is:
Process 1 takes the sideline of the lower half portion of binary image in step S3, is averaged the coordinate in all sidelines to obtain one Line segment;The slope of a line segment is obtained by common least square method, extends a line segment to obtain one according to this slope New straight line, coordinate are denoted as (i, Mi), using new straight line as annulus Preliminary Identification line, this identification line needs to meet:
Li< Mi< Ri
It is considered as if the pixel jump that adjacent rows occurs in identification line and finds annulus, remembers that the point is Ring;
Process 2 arranges to scanning by edge hunting method on the basis of finding point Ring and obtains a new edge line, and note is sat It is designated as (Yj, j), when ordinate is maximized, recording the point is R (Ymax,jmax), the sideline feature is examined, if the sideline Meet condition:
Then it is determined as annulus;
Process 3 then needs to optimize processing to the highway sideline part of annulus if being determined as annulus, finds respectively entire The inflection point A of the image road left side bearing and inflection point B of right side bearing, inflection point A and inflection point B, that is, left side bearing are electrodeless without extreme point and right side bearing Be worth point, if the left side bearing and right side bearing in whole image road find multiple no extreme points respectively, take left and right sideline near Two of ring part are respectively seen as inflection point A and inflection point B without extreme point;Inflection point A and 2 midpoint R of process is inserted using once linear Value method is connected to new sideline, and not connected sideline is constant, similarly tie point B and point R, the secondary sideline after being optimized, And then obtain first time road axis.
Process 4 mends line process and repeats the above process 3 at annulus outlet.
5. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 4, characterized in that Inflection point A, inflection point B and the process of the point R in process 2 are connected in process 3 is:
If A (x1,y1), R (Ymax,jmax), interpolation point (x, y), then interpolation algorithm are as follows:
Similarly connection inflection point B and point R.
6. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 1, characterized in that In step S5, road axis is optimized by common least square method, and final road axis is calculation formula are as follows:
7. a kind of Path Recognition and middle line optimization method based on annulus road according to claim 4, characterized in that two The parts of images of adjacent left and right sides road where sideline, that is, camera of the lower half portion of value image, takes and is equal to image The long part of 1/4 height.
CN201811653805.0A 2018-12-29 2018-12-29 A kind of Path Recognition and middle line optimization method based on annulus road Pending CN109740532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811653805.0A CN109740532A (en) 2018-12-29 2018-12-29 A kind of Path Recognition and middle line optimization method based on annulus road

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811653805.0A CN109740532A (en) 2018-12-29 2018-12-29 A kind of Path Recognition and middle line optimization method based on annulus road

Publications (1)

Publication Number Publication Date
CN109740532A true CN109740532A (en) 2019-05-10

Family

ID=66363104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811653805.0A Pending CN109740532A (en) 2018-12-29 2018-12-29 A kind of Path Recognition and middle line optimization method based on annulus road

Country Status (1)

Country Link
CN (1) CN109740532A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110322457A (en) * 2019-07-09 2019-10-11 中国大恒(集团)有限公司北京图像视觉技术分公司 A kind of de-stacking method of 2D in conjunction with 3D vision
CN111731324A (en) * 2020-05-29 2020-10-02 徐帅 Control method and system for guiding AGV intelligent vehicle based on vision

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110322457A (en) * 2019-07-09 2019-10-11 中国大恒(集团)有限公司北京图像视觉技术分公司 A kind of de-stacking method of 2D in conjunction with 3D vision
CN110322457B (en) * 2019-07-09 2021-05-14 中国大恒(集团)有限公司北京图像视觉技术分公司 2D and 3D vision combined unstacking method
CN111731324A (en) * 2020-05-29 2020-10-02 徐帅 Control method and system for guiding AGV intelligent vehicle based on vision

Similar Documents

Publication Publication Date Title
CN109740532A (en) A kind of Path Recognition and middle line optimization method based on annulus road
US8280165B2 (en) System and method for segmenting foreground and background in a video
CN102750708B (en) Affine motion target tracing algorithm based on fast robust feature matching
CN102693426B (en) Method for detecting image salient regions
CN100590644C (en) Fingerprint identification method combining point with line
CN102222226B (en) Priori analysis based iterative method for segmenting characters of licence plate
US20060269167A1 (en) Image comparison by metric embeddings
CN103218833B (en) The color space the most steady extremal region detection method of Edge Enhancement type
CN105975905A (en) Finger vein quick identification method
CN107992807B (en) Face recognition method and device based on CNN model
CN102567955A (en) Method and system for inpainting images
CN102999890B (en) Based on the image light dynamic changes of strength bearing calibration of environmental factor
CN103577813A (en) Information fusion method for heterogeneous iris recognition
CN107273884A (en) A kind of License Plate Identification method based on mobile terminal camera
CN101707721A (en) Fuzzy reasoning based adaptive spatial error concealment method
CN104537663B (en) A kind of method for quickly correcting of flating
CN104217411B (en) A kind of irregularly quick joining method of broken one-sided image
US20200286239A1 (en) Iterative method for salient foreground detection and multi-object segmentation
CN102045513A (en) Image noise filtering method
Kanungo et al. Parallel genetic algorithm based adaptive thresholding for image segmentation under uneven lighting conditions
CN111047603A (en) Aerial image hybrid segmentation algorithm based on novel Markov random field and region combination
CN106780355A (en) A kind of Enhancement Methods about Satellite Images
CN103577814A (en) Weighting comparison method for motion-blur iris recognition
CN110245600B (en) Unmanned aerial vehicle road detection method for self-adaptive initial quick stroke width
CN111161300A (en) Nilback image segmentation method based on improved Otsu method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination