A kind of domestic environment Xiamen localization method based on binocular vision target detection
Technical field
The present invention relates to robot vision field, is a kind of real-time object localization method, especially a kind of based on binocular
The domestic environment Xiamen localization method of sensation target detection.
Background technology
In recent years, roboticses have obtained constantly developing, in family, office, hospital and work as high and new technology
Factory etc. is widely adopted.It is used for the industrial robot of Intelligent assembly to for public service, home services from workshop
Intellect service robot, robot have increasingly been pressed close to and have been entered in our work and life.Server emerging at present
Qi Ren enterprises and service robot application market are also constantly increasing, so amusement miscellaneous, rescue, monitoring robot
The every aspect of we life is gradually penetrated into.With to the more and more high of service robot degree of intelligence demand, to people
Work technology of identification, human-computer interaction technology, autonomous patrol technology and intelligent control technology etc. require also to heal for the intellectual technology of representative
Come higher.For home-services robot, robot is especially monitored, indoor navigation and independently go on patrol the work(being commonly necessary
Energy.Therefore for the maximum challenge of such robot be on the basis of limited understanding is carried out to surrounding enviroment, can be autonomous hold
The increasing complex task of row.Wherein to robot, map structuring, indoor navigation, autonomous patrol in domestic environment have door
Extremely important meaning.Its reason is as follows:
1. it is geostationary in the position of domestic environment;
2. it is the unique passage for connecting a room and another room;
3. width and shape has unified standard.
But some home services humanoid robots are more because of its integrated functionality, and volume is relatively bulky, but under domestic environment
Door is relatively small.Realize that opposite house is positioned, and pass through door, become the difficult point of robotics development.It is achieved that to household
The positioning of environment Xiamen, for the development tool of roboticses and industry is of great significance.
There are a lot of scientific research institutions and manufacturer all in the orientation problem of research domestic environment Xiamen in the world, imaged by employing
Head, sonar sensor, laser radar sensor etc. are realizing sensor information or multi-sensor information fusion, and propose one and be
The solution of row, such as:
1. in door both sides adhesive label, and the positioning of opposite house is further realized to the positioning of label by monocular vision;
2. using whether having depth saltation zone in sonar sensor or laser radar sensor sniffing robot direction of advance,
And the door positioning to open is realized with reference to known cartographic information;
3., using RGB-D sensors, extracted by the feature of opposite house, and the depth information with reference to each object in the visual field
Realize the positioning of opposite house;
4. monocular vision is adopted, by extracting image center line feature, further mates the various combined situations of door line feature,
Realize the positioning of opposite house.
But said method has certain defect.First, sonar sensor, laser radar sensor price are very high, RGB-D
The price of sensor is not relatively low yet, so the robot with the sensor is difficult the family for being generalized to each economic class
In;And this scheme there is also deficiency, it is impossible to realize positioning to the door that close.Next, although 4 cost of said method 1 and method
Than relatively low, but method 1 needs to modify home environment, and operates relatively complicated, it is difficult to received by user;Method
4 need robot need from door have with a certain distance from just can achieve opposite house positioning, otherwise door with ground boundary can be located at photographic head
Dead range in, be subject in actual applications certain to limit to.
Content of the invention
The present invention proposes a kind of domestic environment Xiamen localization method based on binocular vision target detection, and the method is by adopting
The positioning to domestic environment Xiamen is realized with binocular vision target detection, is effectively solved using sensing by efficient algorithm
The expensive defect of the sensor plans such as device, laser radar sensor, reduces hardware cost;And, this method need not
Increase unnecessary mark on door, more simple and convenient in practical operation;Meanwhile, this method only needs to two side frames of door
Simultaneously appear in the positioning that opposite house is just can achieve in binocular field of view, actually used more flexible;It is right that this method can also be realized
Under domestic environment, the door of different conditions realizes positioning, such as closing, the door of half-open, standard-sized sheet, with more wide application prospect.
Technical scheme provides a kind of domestic environment Xiamen localization method based on binocular vision target detection,
Comprise the following steps:
S101, binocular vision video camera (left video camera and right video camera) is placed in the support apart from ground certain altitude
On, horizontal positioned receives the image I from two-way binocular vision video cameraL、IR;
S102, with the respective image principal point of left video camera and right video cameraCentered on, respectively
Intercept image ILMiddle coordinate isRectangular area and image IRMiddle coordinate isRectangular area (yupAnd ydownFor the upside threshold value and downside threshold value of image interception,
W is image ILAnd IRThe width of image) can intercept after RGB image IL,C, IR,C;
Above-mentioned photographic head parameter is to demarcate to obtain by monocular, such as Zhang Zhengyou standardizitions,
S103, to image IL,C, IR,CGray processing, obtains gray level image I respectivelyL,GAnd IR,G, then respectively to IL,GAnd IR,GEnter
Row Canny operator edge detections, obtain binary image IL,BAnd IR,B;
S104, using accumulated probability Hough transformation algorithm to binary image IL,BAnd IR,BStraight-line segment detection is carried out, and
Extracting wherein slope isLine segment (TdFor angle change threshold value), every line segment is expressed asIn formulaIt is line segment La,iWith straight line yI=yup+1The x of intersection pointIValue, and according to both
Set pattern is then screened to the line segment obtained in two width images, can further obtain line segment group L in left imageL={ LL,1,
LL,2,…,LL,nLAnd right image in line segment group LR={ LR,1,LR,2,…,LR,nR(quantity of the nL for left image middle conductor, nR
Quantity for right image middle conductor);
S105, with line segment group L of left imageLMiddle conductor LL,iOn the basis of, calculate LL,iCorrespond to right image middle conductor group LR?
The matching degree of all line segments in the range of matching somebody with somebody, can obtain meeting the spurious matches line segment of screening threshold value to group { LL,i,:}={ (LL,i,
LR,i1),(LL,i,LR,i2),…,(LL,i,LR,in)};
S106, judge LLIn all of line segment whether complete spurious matches line segment to organize acquisition, if it is not, then turn to step
S105;
S107, obtain line segment group LLIn corresponding line segment group L of each line segmentRIn spurious matches line segment to a group set CMP=
{{LL,0,:},{LL,1,:},…,{LL,nL,:}};
S108, the principle that is mated using global optimum select L from CMPLAnd LRMiddle Optimum Matching line segment is to queue(wherein ix and jx represent line segment respectivelyAnd line segmentIn line segment group LLAnd LRIn sequence number), its corresponding actual vertical line group be L={ L1,L2,…,Ln};
S109, formula of being found range using binocular
Calculate coordinate of corresponding actual vertical line groups L of OMP Q under photographic head coordinate systemWherein, f',For binocular vision photographic head parameter, demarcated by monocular and obtained
, T is the spacing of two photographic head light between centers,The two lines section for respectively matchingWithCentre coordinate
xIValue, xCAnd zCX of the corresponding actual vertical line of two lines section for matching under photographic head coordinate systemC-zCCoordinate;
S110, according to formula(i and j represent line LiWith line LjSequence number in L) meter
Calculate vertical line L in LiWith vertical line LjDistance, and think:
Work as di,j∈[WD,min,WD,max](WD,minAnd WD,maxThe respectively minima of domestic environment gate-width and maximum) when,
Line LiWith line LjMay be two outer rims of door, be designated as doubtful door
Work as di,j∈[WF,min,WF,max](WF,minAnd WF,maxThe respectively wide minima of domestic environment doorframe and maximum)
When, line LiWith line LjMay be the both sides sideline of doorframe, be designated as doubtful doorframe
Calculate in L that institute is the distance between wired, doubtful door group is obtained
(ix and jx represent vertical line L respectivelyix,xAnd Ljx,xSequence number in vertical line group L, D are doubtful door label, and x represents doubtful doorIn DsusIn sequence number), and doubtful doorframe group(ix
Vertical line L is represented respectively with jxix,xAnd Ljx,xSequence number in vertical line group L, F are doubtful doorframe label, and x represents doubtful doorframeIn FsusIn sequence number)
S111, using characteristic-integration principle from doubtful door group DsusMiddle selection optimal solution, integrates maximum doubtful door for most
Excellent solution, that is, realize the identification of opposite house.
Further, in step S104, line segment group L obtained in left imageL={ LL,1,LL,2,…,LL,nLAnd
Line segment group L in right imageR={ LR,1,LR,2,…,LR,nR(quantity of the nL for left image middle conductor, nR are right image middle conductor
Quantity), further include:
S201, leave out length in pixels less than TlengthLine segment;
S202, when there is center distance less than TdisDuring the two lines section of length in pixels, leave out the less line segment of length;
S203, to the line segment in two images according to xIIt is ranked up from small to large;
S204, final line segment group L obtained in left imageL={ LL,1,LL,2,…,LL,nLAnd right image in line segment group LR
={ LR,1,LR,2,…,LR,nR}.
Further, in step S105, line segment group L with left imageLMiddle conductor LL,iOn the basis of, calculate LL,iRight
Should be in right image middle conductor group LRThe matching degree of all line segments in matching range, can obtain the spurious matches line for meeting screening threshold value
Section is to group { LL,i,:}={ (LL,i,LR,i1),(LL,i,LR,i2),…,(LL,i,LR,in), further include:
Line segment group L with left imageL={ LL,1,LL,2,…,LL,nLIn line segment LL,iAs a example by for item to be matched, if which is sat
It is designated asMatching process is as follows:
S301, formula of being found range according to binocularIn conjunction with the scope that actually fathomsDisparity range [d can be obtainedmin,dmax], i.e. line segment group LRIn with LL,iMatch line segment LR,jXISpan isLRIn all meet require line segments be designated as line segment LL,iSpurious matches line segment group;
S302, the matching area for calculating matched line and line to be matched, it is N to be defaulted as widthp, a height of yup+ydown+ 1 square
Shape region, if there are other line segments in the default zone, matching area is changed into the rectangular area between two lines section, if this is silent
Recognize region and exceed image boundary, then matching area is changed into the rectangular area between the line segment and image boundary, and ensures left and right figure
As two pieces of rectangular zone widths to be matched identical;
S303, further calculating obtain line segment LL,iThe left and right sides and a line segment L in its spurious matches line segment groupR,ixLeft
Right matching areaAnd (color space is straight to calculate the feature histogram in 4 Block- matching regions respectively
Fang Tu, such as RGB, HSV, YUV etc., such as Texture similarity, LBP etc., and other feature histograms);
S304, by using similarity measurement (such as Euclidean distance, mahalanobis distance, Pasteur distance etc.) respectively calculate line segment
LL,iAnd LR,ixLeft side matching areaWithLine segment LL,iAnd LR,ixRight side matching areaWithVarious features straight
The similarity of square figure isWith(n is characterized label), and then obtain line segment LL,iAnd LR,ixThe similarity power of the left and right sides
Weight is:
In formulaWithRespectively line segment LL,iWith line segment L to be matchedR,ixSimilarity of the left and right sides with regard to feature k,
akIt is characterized the weight of k matching degrees;
S305, note wi,ixForWithMiddle the greater, if wi,ix> Tm, then it is assumed that line segment L to be matchedR,ixFor LL,iDoubt
Like coupling line segment, spurious matches line segment is constituted to (LL,i,LR,ix);
S306, determine whether other line segments do not complete coupling, if so, then turn to step S302;
S307, the spurious matches line segment pair for further all being met screening threshold value, constitute spurious matches line segment to group
{LL,i,:}={ (LL,i,LR,i1),(LL,i,LR,i2),…,(LL,i,LR,in), n be mate line segment to mate in group to number.
Further, in step S108, the principle of the employing global optimum coupling selects L from CMPLAnd LRIn most
Excellent coupling line segment is to queue(wherein ix and jx are represented respectively
Line segmentAnd line segmentIn line segment group LLAnd LRIn sequence number), its corresponding actual vertical line group be L={ L1,L2,…,Ln,
Further include:
S401, L is extracted from CMPLAnd LRIn all of coupling line segment to queue MPQ={ (LL,i1,LR,j1),(LL,i2,
LR,j2),…,(LL,in,LR,jn) (wherein ix and jx represent line segment L respectivelyL,ixWith line segment LR,jxIn line segment group LLAnd LRIn sequence
Number), each MPQ={ (LL,i1,LR,j1),(LL,i2,LR,j2),…,(LL,in,LR,jn) following rule should be met:
1. to be respectively less than which to the label of each the spurious matches line segment centering two lines section in queue direct for coupling line segment
The corresponding label of follow-up spurious matches line segment centering two lines section, i.e., for spurious matches line segment pairWith doubtful
Match somebody with somebody line segment pairI need to be metk< ik+1&&jk< jk+1;
2. the label of the internal two lines section of first spurious matches line segment during coupling line segment is to queue need to meet current
With line segment to the label for not having the internal two lines section of other spurious matches line segments in queue less than its reference numeral, i.e., for doubtful
Like coupling line segment pairTo there is no spurious matches line segment pair in queue in current matching line segmentMeet ik
< i1||jk< j1;
3. coupling line segment need to be met currently to the label of the internal two lines section of last spurious matches line segment in queue
Coupling line segment to the label that do not have the internal two lines section of other spurious matches line segments in queue more than its reference numeral, i.e., for
Coupling line segment pairTo there is no coupling line segment pair in queue in current matching line segmentMeet ik> in|
|jk> jn;
S402, calculate each coupling the total weight of line segment to queue:
In formula i be coupling sequence number of the line segment to queue, n be current matching line segment to queue mate to number, rhoLi,Rj
It is by LLIn Li-th article of line segment and LRIn the Rj-th article line segment composition spurious matches line segment pair matching degree;
S403, all coupling total weights of the line segment to queue of calculating, the maximum coupling line segment of weighted value is complete to queue
Office's optimal solution, is designated as
Further, in step S111, the characteristic-integration principle is further included:
With doubtful door(ix and jx is line Lix,iAnd Ljx,iSequence number in L, D are doubtful door label, and i is doubtful
Like doorIn doubtful door group DsusIn sequence number) as a example by, initial integration is 0, and characteristic-integration computational methods include:
If there is doorjamb on the left of the doubtful doors of S501, i.e., doubtful doorLeft side bearing LixThere is line L in right sidemFull
Foot (Lix,Lm)∈Fsus, then bonus point SF,L;
If there is doorjamb on the right side of the doubtful doors of S502, i.e., doubtful doorRight side bearing LjxThere is line L in left sidenFull
Foot (Ln,Ljx)∈Fsus, then bonus point SF,R;
For line LxIt is imaged as mating in the photographic head of left and right line segment in binocular to (LL,ix,LR,jx), for line segment LL,ixWith
LR,jxThe matching degree of the left and right sidesWithThere are three kinds of situations:
T in formulamFor matching degree threshold value;
If the doubtful doors of S503Sideline LixLeft and right sides matching degreeWithMeet formula (1), then plus
Divide SM,1;Bonus point S if formula (2) is metM,2;If meeting formula (3), deduction SM,3;
If the doubtful doors of S504Sideline LjxLeft and right sides matching degreeWithMeet formula (1), then plus
Divide SM,1;Bonus point S if formula (3) is metM,2;If meeting formula (2), deduction SM,3;
If the doubtful doors of S505There is left frame (Lix,Lm) when, if sideline LmLeft and right sides matching degreeWithMeet formula (1) or formula (2), then bonus point SM,2;If meeting formula (3), deduction SM,3;
If the doubtful doors of S506There is left frame (Ln,Ljx) when, if sideline LnLeft and right sides matching degreeWithMeet formula (1) or formula (3), then bonus point SM,2;If meeting formula (2), deduction SM,3;
If S507 is in doubtful doorThe depth that there is actual line in the middle of two side lines is undergone mutation, that is, there is LkIn
LixAnd LjxBetween, and meet(TZIt is distance mutation threshold value), then bonus point Sz,1;
If S508 is in doubtful doorThe depth that there is actual point in the middle of two side lines is undergone mutation, that is, there is matching angle
Point PmIn LixAnd LjxBetween, and meetThen bonus point Sz,1.
Further, in step S508, the matching angle point is further included:
The coupling angle point refers to by ORB Corner Detection Algorithms, SURF Corner Detections, FAST Corner Detection scheduling algorithms to image
IL,CAnd IR,CThe angle point for detecting, and coupling angle point the GM={ (P obtained using BF matching algorithms or FLANN matching algorithmsL,i1,
PR,j1),(PL,i2,PR,j2),…,(PL,in,PR,jn), and its coordinate under photographic head coordinate system is obtained by binocular range finding formula
Further, in step S111, the employing characteristic-integration principle is from doubtful door group DsusMiddle selection is optimum
Solution, it is optimal solution to integrate maximum doubtful door, further includes:
Calculate doubtful door group DsusIn all doubtful doors integration Ssus={ S1,S2,…,Sn, take integration maximum and meet
Smax≥Ts(TsIntegral threshold) doubtful door be optimal solution;If there is the doubtful door of maximum integration identical, doubtful door is selected
Central point to photographic head zero distance most short doubtful door be optimal solution.
Technical solution of the present invention effectively realizes the door under domestic environment using binocular vision video camera by efficient algorithm
Positioning, and unnecessary mark need not be increased on door, it is only necessary to two side frames of door are simultaneously appeared in binocular field of view
Just the positioning of opposite house is can achieve, the door in various states such as closing, half-open, standard-sized sheets effectively can be recognized, with cost
The extensive advantage of low, easy to use and flexible, application scenarios.
Other features and advantages of the present invention will be illustrated in the following description, also, partly be become from description
Obtain it is clear that or being understood by implementing the present invention.The purpose of the present invention and other advantages can pass through in the explanation that is write
In book, claims and accompanying drawing, specifically noted structure is realizing and obtain.
Below by drawings and Examples, technical scheme is described in further detail.
Description of the drawings
Accompanying drawing is used for providing a further understanding of the present invention, and constitutes a part for description, the reality with the present invention
Applying example is used for explaining the present invention together, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the flow process of the domestic environment Xiamen localization method in the embodiment of the present invention one based on binocular vision target detection
Figure;
Fig. 2 is illustrated by carrying out the pixel coordinate system that image interception is used in the embodiment of the present invention one to left and right video camera
Figure;
Fig. 3 is the flow process of the domestic environment Xiamen localization method in the embodiment of the present invention one based on binocular vision target detection
Schematic diagram;
Fig. 4 is photographic head coordinate system schematic diagram in step S109 in the embodiment of the present invention one;
Fig. 5 is the width information integration schematic diagram of door in step S501, S502 in the embodiment of the present invention one;
Fig. 6 is to judging to be the method flow of the line segment of doorjamb in two road images of left and right in the embodiment of the present invention one
Figure;
Fig. 7 is the method flow diagram for finding left and right coupling line segment in the embodiment of the present invention one;
Fig. 8 is to obtain method flow diagram of the coupling line segment to group according to global registration principle in the embodiment of the present invention one;
Fig. 9 is the method for carrying out bonus point according to characteristic-integration principle to doubtful doorjamb line segment in the embodiment of the present invention one
Flow chart.
Specific embodiment
The preferred embodiments of the present invention are illustrated below in conjunction with accompanying drawing, it will be appreciated that preferred reality described herein
Apply example to be merely to illustrate and explain the present invention, be not intended to limit the present invention.
As shown in Figures 1 to 5, the flow process is comprised the following steps:
S101, binocular vision video camera (left video camera and right video camera) is placed in the support apart from ground certain altitude
On, horizontal positioned receives the image I from two-way binocular vision video cameraL、IR;
S102, with the respective image principal point of left video camera and right video cameraCentered on, respectively
Intercept image ILMiddle coordinate isRectangular area and image IRMiddle coordinate isRectangular area (yupAnd ydownFor the upside threshold value and downside threshold value of image interception,
W is image ILAnd IRThe width of image) can intercept after RGB image IL,C, IR,C;
Above-mentioned photographic head parameter is to demarcate to obtain by monocular, such as Zhang Zhengyou standardizitions.
S103, to image IL,C, IR,CGray processing, obtains gray level image I respectivelyL,GAnd IR,G.Again respectively to IL,GAnd IR,GEnter
Row Canny operator edge detections, obtain binary image IL,BAnd IR,B;
S104, using accumulated probability Hough transformation algorithm to binary image IL,BAnd IR,BStraight-line segment detection is carried out, and
Extracting wherein slope isLine segment (TdFor angle change threshold value).Every line segment is expressed asIn formulaIt is line segment La,iWith straight line yI=yupThe x of+1 intersection pointIValue.And according to
Established rule is screened to the line segment obtained in two width images.Line segment group L in left image can further be obtainedL={ LL,1,
LL,2,…,LL,nLAnd right image in line segment group LR={ LR,1,LR,2,…,LR,nR(quantity of the nL for left image middle conductor, nR
Quantity for right image middle conductor);
S105, with line segment group L of left imageLMiddle conductor LL,iOn the basis of, calculate LL,iCorrespond to right image middle conductor group LR?
The matching degree of all line segments in the range of matching somebody with somebody, can obtain meeting the spurious matches line segment of screening threshold value to group { LL,i,:}={ (LL,i,
LR,i1),(LL,i,LR,i2),…,(LL,i,LR,in)};
S106, judge LLIn all of line segment whether complete spurious matches line segment to organize acquisition, if it is not, then turn to step
S105;
S107, obtain line segment group LLIn corresponding line segment group L of each line segmentRIn spurious matches line segment to a group set CMP=
{{LL,0,:},{LL,1,:},…,{LL,nL,:}};
S108, the principle that is mated using global optimum select L from CMPLAnd LRMiddle Optimum Matching line segment is to queue(wherein ix and jx represent line segment respectivelyAnd line segmentIn line segment group LLAnd LRIn sequence number), its corresponding actual vertical line group be L={ L1,L2,…,Ln};
S109, formula of being found range using binocular
Calculate coordinate of corresponding actual vertical line groups L of OMPQ under photographic head coordinate systemWherein, f',For binocular vision photographic head parameter, demarcated by monocular and obtained
, T is the spacing of two photographic head light between centers,The two lines section for respectively matchingWithCentre coordinate
xIValue, xCAnd zCX of the corresponding actual vertical line of two lines section for matching under photographic head coordinate systemC-zCCoordinate;
S110, according to formula(i and j represent line LiWith line LjSequence number in L) meter
Calculate vertical line L in LiWith vertical line LjDistance, and think:
Work as di,j∈[WD,min,WD,max](WD,minAnd WD,maxThe respectively minima of domestic environment gate-width and maximum) when,
Line LiWith line LjMay be two outer rims of door, be designated as doubtful door
Work as di,j∈[WF,min,WF,max](WF,minAnd WF,maxThe respectively wide minima of domestic environment doorframe and maximum)
When, line LiWith line LjMay be the both sides sideline of doorframe, be designated as doubtful doorframe
Calculate in L that institute is the distance between wired, doubtful door group is obtained
(ix and jx represent vertical line L respectivelyix,xAnd Ljx,xSequence number in vertical line group L, D are doubtful door label, and x represents doubtful doorIn DsusIn sequence number), and doubtful doorframe group
(ix and jx represent vertical line L respectivelyix,xAnd Ljx,xSequence number in vertical line group L, F are doubtful doorframe label, and x represents doubtful doorframeIn FsusIn sequence number)
S111, using characteristic-integration principle from doubtful door group DsusMiddle selection optimal solution, integrates maximum doubtful door for most
Excellent solution, that is, realize the identification of opposite house.
Fig. 6 is to judging to be the method flow of the line segment of doorjamb in two road images of left and right in the embodiment of the present invention one
Figure, i.e., in step S104, obtain line segment group L in left and right imageLAnd LRMethod and step.As shown in fig. 6, the flow process includes
Following steps:
S201, leave out length in pixels less than TlengthLine segment;
S202, when there is center distance less than TdisDuring the two lines section of length in pixels, leave out the less line segment of length;
S203, to the line segment in two images according to xIIt is ranked up from small to large;
S204, final line segment group L obtained in left imageL={ LL,1,LL,2,…,LL,nLAnd right image in line segment group LR
={ LR,1,LR,2,…,LR,nR}.
Fig. 7 is the method flow diagram for finding left and right coupling line segment in the embodiment of the present invention one, i.e., in step S105, with a left side
Line segment group L of imageLMiddle conductor LL,iOn the basis of, calculate LL,iCorrespond to right image middle conductor group LRAll line segments in matching range
Matching degree, obtain meeting the spurious matches line segment of screening threshold value to group { LL,i,:}={ (LL,i,LR,i1),(LL,i,LR,i2),…,
(LL,i,LR,in) flow process.As shown in fig. 7, the flow process is comprised the following steps:
S301, formula of being found range according to binocularIn conjunction with the scope that actually fathomsDisparity range [d can be obtainedmin,dmax], i.e. line segment group LRIn with LL,iMatch line segment LR,jXI spans beLRIn all meet require line segments be designated as line segment LL,iSpurious matches line segment group;
S302, the matching area for calculating matched line and line to be matched, it is N to be defaulted as widthp, a height of yup+ydown+ 1 square
Shape region, if there are other line segments in the default zone, matching area is changed into the rectangular area between two lines section, if this is silent
Recognize region and exceed image boundary, then matching area is changed into the rectangular area between the line segment and image boundary, and ensures left and right figure
As two pieces of rectangular zone widths to be matched identical;
S303, further calculating obtain line segment LL,iThe left and right sides and a line segment L in its spurious matches line segment groupR,ixLeft
Right matching areaAnd (color space is straight to calculate the feature histogram in 4 Block- matching regions respectively
Fang Tu, such as RGB, HSV, YUV etc., such as Texture similarity, LBP etc., and other feature histograms);
S304, by using similarity measurement (such as Euclidean distance, mahalanobis distance, Pasteur distance etc.) respectively calculate line segment
LL,iAnd LR,ixLeft side matching areaWithLine segment LL,iAnd LR,ixRight side matching areaWithVarious features straight
The similarity of square figure isWith(n is characterized label), and then obtain line segment LL,iAnd LR,ixThe similarity power of the left and right sides
Weight is:
In formulaWithRespectively line segment LL,iWith line segment L to be matchedR,ixSimilarity of the left and right sides with regard to feature k,
akIt is characterized the weight of k matching degrees;
S305, note wi,ixForWithMiddle the greater.If wi,ix> Tm, then it is assumed that line segment L to be matchedR,ixFor LL,iDoubt
Like coupling line segment, spurious matches line segment is constituted to (LL,i,LR,ix);
S306, determine whether other line segments do not complete coupling, if so, then turn to step S302;
S307, the spurious matches line segment pair for further all being met screening threshold value, constitute spurious matches line segment to group
{LL,i,:}={ (LL,i,LR,i1),(LL,i,LR,i2),…,(LL,i,LR,in), n be mate line segment to mate in group to number.
Fig. 8 is to obtain method flow diagram of the coupling line segment to group according to global registration principle in the embodiment of the present invention one, i.e.,
In step S108, the principle that is mated using global optimum selects L from CMPLAnd LRMiddle Optimum Matching line segment is to queue(wherein ix and jx represent line segment respectivelyAnd line segmentIn line segment group LLAnd LRIn sequence number, its corresponding actual vertical line group be L={ L1,L2,…,Ln) method.Such as Fig. 8 institutes
Show, the flow process is comprised the following steps:
S401, L is extracted from CMPLAnd LRIn all of coupling line segment to queue MPQ={ (LL,i1,LR,j1),(LL,i2,
LR,j2),…,(LL,in,LR,jn) (wherein ix and jx represent line segment L respectivelyL,ixAnd line segmentIn line segment group LLAnd LRIn sequence
Number), each MPQ={ (LL,i1,LR,j1),(LL,i2,LR,j2),…,(LL,in,LR,jn) following rule should be met:
1. to be respectively less than which to the label of each the spurious matches line segment centering two lines section in queue direct for coupling line segment
The corresponding label of follow-up spurious matches line segment centering two lines section, i.e., for spurious matches line segment pairWith doubtful
Match somebody with somebody line segment pairI need to be metk< ik+1&&jk< jk+1;
2. the label of the internal two lines section of first spurious matches line segment during coupling line segment is to queue need to meet current
With line segment to the label for not having the internal two lines section of other spurious matches line segments in queue less than its reference numeral, i.e., for doubtful
Like coupling line segment pairTo there is no spurious matches line segment pair in queue in current matching line segmentMeet ik
< i1||jk< j1;
3. coupling line segment need to be met currently to the label of the internal two lines section of last spurious matches line segment in queue
Coupling line segment to the label that do not have the internal two lines section of other spurious matches line segments in queue more than its reference numeral, i.e., for
Coupling line segment pairTo there is no coupling line segment pair in queue in current matching line segmentMeet ik> in|
|jk> jn;
S402, calculate each coupling the total weight of line segment to queue:
In formula i be coupling sequence number of the line segment to queue, n be current matching line segment to queue mate to number, rhoLi,Rj
It is by LLIn Li-th article of line segment and LRIn the Rj-th article line segment composition spurious matches line segment pair matching degree;
S403, all coupling total weights of the line segment to queue of calculating, the maximum coupling line segment of weighted value is complete to queue
Office's optimal solution, is designated as
Fig. 9 is the method for carrying out bonus point according to characteristic-integration principle to doubtful doorjamb line segment in the embodiment of the present invention one
In flow chart, i.e. step S111, characteristic-integration computational methods.As shown in figure 9, the flow process is comprised the following steps:
If there is doorjamb on the left of the doubtful doors of S501, i.e., doubtful doorLeft side bearing LixThere is line L in right sidemFull
Foot (Lix,Lm)∈Fsus, then bonus point SF,L;
If there is doorjamb on the right side of the doubtful doors of S502, i.e., doubtful doorRight side bearing LjxThere is line L in left sidenFull
Foot (Ln,Ljx)∈Fsus, then bonus point SF,R;
For line LxIt is imaged as mating in the photographic head of left and right line segment in binocular to (LL,ix,LR,jx), for line segment LL,ixWith
LR,jxThe matching degree of the left and right sidesWithThere are three kinds of situations:
T in formulamFor matching degree threshold value;
If the doubtful doors of S503Sideline LixLeft and right sides matching degreeWithMeet formula (1), then plus
Divide SM,1;Bonus point S if formula (2) is metM,2;If meeting formula (3), deduction SM,3;
If the doubtful doors of S504Sideline LjxLeft and right sides matching degreeWithMeet formula (1), then plus
Divide SM,1;Bonus point S if formula (3) is metM,2;If meeting formula (2), deduction SM,3;
If the doubtful doors of S505There is left frame (Lix,Lm) when, if sideline LmLeft and right sides matching degree
WithMeet formula (1) or formula (2), then bonus point SM,2;If meeting formula (3), deduction SM,3;
If the doubtful doors of S506There is left frame (Ln,Ljx) when, if sideline LnLeft and right sides matching degreeWithMeet formula (1) or formula (3), then bonus point SM,2;If meeting formula (2), deduction SM,3;
If S507 is in doubtful doorThe depth that there is actual line in the middle of two side lines is undergone mutation, that is, there is LkIn
LixAnd LjxBetween, and meet(TZIt is distance mutation threshold value), then bonus point Sz,1;
If S508 is in doubtful doorThe depth that there is actual point in the middle of two side lines is undergone mutation, that is, there is coupling
Angle point PmIn LixAnd LjxBetween, and meetThen bonus point Sz,1.
Coupling angle point refers to by ORB Corner Detection Algorithms, SURF Corner Detections, FAST Corner Detections scheduling algorithm to image IL,C
And IR,CThe angle point for detecting, and coupling angle point the GM={ (P obtained using BF matching algorithms or FLANN matching algorithmsL,i1,
PR,j1),(PL,i2,PR,j2),…,(PL,in,PR,jn), and its coordinate under photographic head coordinate system is obtained by binocular range finding formula
Technical scheme in above-described embodiment is due to using binocular vision video camera, effectively realizing house by efficient algorithm
Door positioning under habitat environment, and unnecessary mark need not be increased on door, it is only necessary to two side frames of door occur simultaneously
Just the positioning of opposite house is can achieve in binocular field of view, and the door in various states such as closing, half-open, standard-sized sheets effectively can be known
Not, with low cost, easy to use and flexible, the extensive advantage of application scenarios.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can adopt complete hardware embodiment, complete software embodiment or with reference to software and hardware in terms of reality
Apply the form of example.And, the present invention can be adopted in one or more computers for wherein including computer usable program code
The shape of the upper computer program that implements of usable storage medium (including but not limited to disk memory and optical memory etc.)
Formula.
The present invention is the flow process with reference to method according to embodiments of the present invention, equipment (system) and computer program
Figure and/or block diagram are describing.It should be understood that can be by computer program instructions flowchart and/or each stream in block diagram
Journey and/or the combination of square frame and flow chart and/or the flow process in block diagram and/or square frame.These computer programs can be provided
Instruct the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices
The device of the function of specifying in present one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in and can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory is produced to be included referring to
Make the manufacture of device, the command device realize in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or
The function of specifying in multiple square frames.
These computer program instructions can be also loaded in computer or other programmable data processing devices so that in meter
Series of operation steps is executed on calculation machine or other programmable devices to produce computer implemented process, so as in computer or
The instruction executed on other programmable devices is provided for realization in one flow process of flow chart or multiple flow processs and/or block diagram one
The step of function of specifying in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention
God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising these changes and modification.