A kind of method and odometer of the monocular vision measurement mileage based on characteristics of imageTechnical field
The present invention relates to a kind of technical field of image processing, in particular to a kind of monocular vision measurement based on characteristics of imageThe method and odometer of mileage.
Background technique
During metro operation, the tables such as tunnel structure outlet percolating water or crack, peeling based on concrete materialDefect and tunnel cross-section deformation are seen, is all unavoidable defect phenomenon, and the long-run development of disease is to the safety in tunnelProperty causes irreversible negative effect.It therefore, is to ensure tunnel long-term safety to the maintenance of tunnel structure in metro operationThe necessary means of operation.The position control of sensor directly influences the validity of detection data acquisition in the detection process.MeshBefore, the sensor position of most subway tunnel defect detections is all to carry out setting in advance to finish at this stage, for different tunnelsRoad section environment cannot usually improve the validity of data by position adjustment, reduce the difficulty of software analysis.In recent years,With computer technology, Theory of Automatic Control, embedded development, chip design and the rapid development of sensor technology allow tunnelRoad disease is detected automatically and is achieved, and extracts scene image on the detection vehicle of real time execution or image sequence is handled, mentionTake the validity feature of measured target, obtain extraterrestrial target real-time pose information, be subsequent tunnel defect image position with it is innerJourney provides support.But due to the technical restriction of monocular-camera, it is desirable to which the three-dimensional coordinate information for obtaining mobile object is veryDifficult.There are three types of generating modes for monocular vision, and one is being generated by perspective geometry, with reference to end point, one is pass through meshTarget is displaced to be formed, and the method for this generation is that restricted condition, such as camera is wanted to fix, and background is fixed, the speed of personageConstant, then the movement speed of target is faster, he is closer to camera.There are also one is pass through focal length.By different focal length to sameThe blur effect of one scene camera shooting measures.This method effect for the entire image of generation is not also fine, butIt is numerical value but than calibrated.Binocular vision is by parallax effect.This effect is the main reason for being capable of forming three-dimensional stereopsis.Monocular finds parallax effect also mainly by by finding object of reference to generate three-dimensional depth information at present.Monocular estimationThe problem of pose is a three-dimensional scene structure needs through the mobile triangle geometrical relationship to constitute character pair point of interframe.After triangle geometrical relationship is established, the three-dimensional coordinate of pose and characteristic point solves simultaneously, this is classical three-dimensional scenic knotStructure problem.Therefore there is no first have chicken still first to have the problem of egg.The solution of three-dimensional scene structure has very much, most can simply lead toEstimation essential matrix is crossed, the rotation R for obtaining camera and displacement T are then decomposed.In binocular stereo vision, due to baseLine is fixed and known, thus can directly trigonometric ratio obtain characteristic point three-dimensional coordinate.Then the motion information of interframeIt is exactly the kinematic parameter fitting between two heap three-dimensional points;The shortcomings that binocular is, due to baseline be it is fixed, simultaneously because carrier rulerVery little limitation, usually will not be very wide.Therefore the precision that trigonometric ratio is rebuild generally is not likely to very high.
Therefore, it is necessary to develop a kind of Method for Calculate Mileage based on monocular vision, compare based on sift, HarrisThe method of angle point, survey calculation characteristics of image speed faster, and have rotation scale invariability, being capable of real time processed images.
Summary of the invention
The mileage measurement method based on monocular vision that the technical problem to be solved in the present invention is to provide a kind of, equipment is simple,Cost reduces;It compares based on sift, the method for Harris angle point, survey calculation characteristics of image speed faster, and has rotationScale invariability, the measurement method for the monocular vision mileage based on characteristics of image that can be handled in real time.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is that: should monocular vision based on characteristics of imageThe method for measuring mileage, specifically comprises the following steps:
(1) camera is demarcated, obtains the inside and outside parameter of the camera;
(2) the 2D characteristic point of the adjacent two field pictures in front and back is calculated along direction of advance;
(3) the 2D characteristic point is matched, finds corresponding characteristic point in the two field pictures;
(4) the 3D coordinate of corresponding characteristic point described in two field pictures is calculated, and according to the 3D of the corresponding characteristic pointCoordinate calculates the camera pose with 2D coordinate, obtains the relative displacement of the camera;
(5) step (1)~(4) successively are repeated to subsequent frame, calculates the position of camera opposite former frame when shooting each frameIt moves, all displacements that finally adds up obtain mileage.
By adopting the above technical scheme, mileage is measured by using monocular vision, is compared to based on binocular visionMethod, equipment is simple, cost reduce;It compares based on sift, HarrisThe method of angle point calculates characteristics of image speed moreFastly, and there is rotation scale invariability, can handles in real time.
The present invention further improvement lies in that, step (1) includes the following steps:
1-1, according to national forest park in Xiaokeng, obtain the conversion relation of image coordinate system, camera coordinates system and world coordinate system;
1-2, by shooting the gridiron pattern scaling board under multiple different perspectivess, and extract the angle point on scaling board image, rootThe pixel coordinate and physical coordinates of angle point are obtained, according to gridiron pattern size so as to find out the homography matrix H of all scaling board images;
1-3, inside and outside parameter is solved;
1-4, minimum projection error is solved by Levenberg-Marquardt algorithm, optimize camera inside and outside parameter.
Preferably, 2D characteristic point, that is, orb characteristic point described in step (2) calculates the orb characteristic point of front and back two field picturesSpecifically comprise the following steps: that constructing image pyramid extracts key point at every layer, then according to brief according to fast algorithmAlgorithm, the selected point pair around the key point generate description, further according to key point and gray scale matter by comparing pixel valueThe angle of the heart is sub to adjust description, so that description has rotational invariance, it is sub to finally obtain orb description.
2D Feature Points Matching described in step (3) specifically comprises the following steps:
3-1, k-d tree is established for the feature point set in image, i.e., selection has the dimension k of maximum variance in data set;Then select the value in k dimension for the characteristic point of intermediate value m be division node;By being divided into less than m of the value on dimension kValue on dimension k is divided into right subspace greater than m by left subspace;It is carried out respectively in left subspace and right subspaceState operation, until cannot it is subdivided until, obtain k-d tree;
3-2, characteristic matching lookup is carried out with bbf searching algorithm: i.e. since the root node of k-d tree, carrying out binary search,By the node in query path according to being respectively ranked up at a distance from query point;When being recalled, from the tree of highest priorityNode starts, and when all nodes, which all pass through, to be checked or limit beyond runing time, will be used as apart from shortest point nearestAdjacent matching characteristic point.
Step (4) specifically comprises the following steps:
4-1, it is arrived according to the pixel size and physical size of image using the image upper left corner as coordinate origin with image takingRegion be plane establish coordinate system, obtain the 3D coordinate of the characteristic point;
4-2, according to 3D coordinate in previous frame image of camera internal reference, the characteristic point and this feature point latter2D coordinate in frame image, using coordinate transformation relationship, find out camera after the picture is taken a frame when pose, and then find out camera and existShoot the displacement between former frame and latter frame position.
The conversion relation of image coordinate system, camera coordinates system and world coordinate system is specifically in the step 1-1:
(1.11) under world coordinate system, the coordinate of some point is [Xw, Yw, Zw], by under camera coordinates system, the anglePoint coordinate is [Xc, Yc, Zc], by rotating the correspondent transform relationship with translation,Wherein R is spin matrix, and T is the displacement of two coordinate origins, then has
(1.12) point is after camera imaging, and point is [x, y] in the coordinate system that image physical size indicates, according to similarTriangle relation hasWherein f is the focal length of camera, i.e.,
(1.13) shown in the relationship such as formula (3) of image pixel dimensions coordinate system and image physical size coordinate system, which existsThe coordinate system that image pixel dimensions indicate is [u, v], then has corresponding relationship:Wherein (u0, v0) it is image slicesPlain center, dxPhysical size for a pixel in x-axis direction, dyFor a pixel y-axis direction physical size to get
(1.14) in summary formula (1), formula (2), formula (3) relationship, can obtain:
(1.15) consider that degree of bias parameter C is added, finally have
(1.16) because gridiron pattern scaling board is plane, Z is setw=0, if A indicates camera matrix,r1, r2, r3For the column vector of R, t is translation column vector, then formula (5) can be written as
Homography matrix H is solved, shoots the gridiron pattern scaling board under multiple different perspectivess, and extract on scaling board imageAngle point.Tessellated size is it is known that so the pixel coordinate of angle point can be obtained with physical coordinates again.Pass through least squareMethod, can be in the hope of homography matrix H, the H=[h of all scaling board images1 h2 h3], according to formula (6), λ is enabled to indicate some oftenNumber, available [h1 h2 h3]=λ A [r1 r2t]; (7)
If α, beta, gamma is respectively x-axis, y-axis, the rotation angle in z-axis direction, then spin matrixIt is availableAndTo obtain the final product | | r1| |=(cos γ cos β+sin γsinα sinβ)2+(-sinγ cosβ+cosγ sinα sinβ)2+(cosα sinβ)2=1, and | | r2| |=(sin γcosα)2+(cosγ cosα)2+(-sinα)2=1, so | | r1| |=| | r2| |=1. (8)
Calculate r1·r2=(cos γ cos β+sin γ sin α sin β) (sin γ cos α)+(- sin γ cos β+cosγ sin α sin β) (cos γ cos α)+(cos α sin β) (- sin α)=0, (9)
It is available according to above-mentioned formula (7), formula (8), formula (9):
That is h1TA-TA-1h2=0; (10)
Up to h1TA-TA-1h1=h2TA-TA-1h2。 (11)
Equation group is established according to above-mentioned formula (10), formula (11), by several groups of homography matrix value bands obtained in step (1.2)Enter into equation group, can solve to obtain internal reference matrix A;
It enablesIf hi=[hi1, hi2, hi3]T, then haveWherein b=[B11, B12, B22, B13, B23, B33]T, vij=[hi1hj1, hi1hj2+ hi2hj1, hi2hj2, hi3hj1+hi1hj3, hi3hj2+hi2hj3,hi3hj3]T;So above-mentioned formula (10), formula (11) can be written asBring all homography matrixes intoValue, solves b, then solves each element value and outer ginseng in internal reference matrix A again.
The present invention also provides a kind of monocular vision odometer based on characteristics of image, using above based on the list of characteristics of imageThe method of mesh vision measurement mileage carries out mileage calculation.
Compared with prior art, of the invention have the advantages that is compared to the method based on binocular vision, ifStandby simple, cost reduces;It comparing based on sift, the method for Harris angle point measures and calculates characteristics of image speed faster, andWith rotation scale invariability, can handle in real time.
Detailed description of the invention
Fig. 1 is the national forest park in Xiaokeng figure for the method that the monocular vision of the invention based on characteristics of image measures mileage;
Fig. 2 is adjacent two frame in front and back of the shooting for the method that the monocular vision of the invention based on characteristics of image measures mileageSchematic diagram.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention figure, technical solution in the embodiment of the present invention carries out clearChu, complete description.
Embodiment 1: it should be applied based on the method for the monocular vision measurement mileage of characteristics of image in vehicle-mounted Tunnel testing equipmentIn, specifically comprise the following steps:
(1) camera is demarcated first, obtains the parameter of camera;
(2) before and after the direction of advance of vehicle successively calculates two frames 2D characteristic point;
(3) the 2D characteristic point is matched, finds corresponding characteristic point;
(4) the 3D coordinate of characteristic point is calculated, and posture is calculated according to the 3D coordinate of characteristic point and 2D coordinate, is obtained oppositeDisplacement;
(5) same method successively is taken to the subsequent frame measured, calculates camera opposite former frame when shooting each frameDisplacement, all displacements that finally adds up obtain mileage;
As shown in Figure 1, using gridiron pattern calibration algorithm in the step (1), camera is demarcated, obtains camera internal referenceSpecifically includes the following steps:
(1.1) it according to national forest park in Xiaokeng, is closed by the transformation under image coordinate system, camera coordinates system, world coordinate systemSystem has:
(1.11) under world coordinate system, the coordinate of some point is [Xw, Yw, Zw], by under camera coordinates system, the anglePoint coordinate is [Xc, Yc, Zc], by rotating the correspondent transform relationship with translation,Wherein R is spin matrix, and T is the displacement of two coordinate origins, then has
(1.12) point is after camera imaging, and point is [x, y] in the coordinate system that image physical size indicates, according to similarTriangle relation hasWherein f is the focal length of camera, i.e.,
(1.13) shown in the relationship such as formula (3) of image pixel dimensions coordinate system and image physical size coordinate system, which existsThe coordinate system that image pixel dimensions indicate is [u, v], then has corresponding relationship:Wherein (u0, v0) it is image slicesPlain center, dxPhysical size for a pixel in x-axis direction, dyFor a pixel y-axis direction physical size to get
(1.14) in summary formula (1), formula (2), formula (3) relationship, can obtain:
(1.15) consider that degree of bias parameter C is added, finally have
(1.16) because gridiron pattern scaling board is plane, Z is setw=0, if A indicates camera matrix,r1, r2, r3For the column vector of R, t is translation column vector, then formula (5) can be written as
(1.2) homography matrix H is solved, shoots the gridiron pattern scaling board under multiple different perspectivess, and extract scaling board figureAs upper angle point.Tessellated size is it is known that so the pixel coordinate of angle point can be obtained with physical coordinates again.Pass through minimumSquare law, can be in the hope of the homography matrix H of all scaling board images.
(1.3) homography matrix H=[h1 h2 h3], according to formula (6), λ is enabled to indicate some constant, available [h1 h2h3]=λ A [r1 r2t]; (7)
If α, beta, gamma is respectively x-axis, y-axis, the rotation angle in z-axis direction, then spin matrixIt is availableAndTo obtain the final product | | r1| |=(cos γ cos β+sin γsinα sinβ)2+(-sinγ cosβ+cosγ sinαs inβ)2+(cosα sinβ)2=1, and | | r2| |=(sin γcosα)2+(cosγ cosα)2+(-sinα)2=1, so | | r1| |=| | r2| |=1. (8)
Calculate r1·r2=(cos γ cos β+sin γ sin α sin β) (sin γ cos α)+(- sin γ cos β+cosγ sin α sin β) (cos γ cos α)+(cos α sin β) (- sin α)=0, (9)
It is available according to above-mentioned formula (7), formula (8), formula (9):
Up to h1TA-TA-1h1=h2TA-TA-1h2。 (11)
(1.4) it solves inside and outside parameter: equation group being established according to above-mentioned formula (10), formula (11), will be obtained in step (1.2)Several groups of homography matrix values be brought into equation group, can solve to obtain internal reference matrix A;
It enablesIf hi=[hi1, hi2, hi3]T, then haveWherein b=[B11, B12, B22, B13, B23, B33]T, vij=[hi1hj1, hi1hj2+ hi2hj1, hi2hj2, hi3hj1+hi1hj3, hi3hj2+hi2hj3,hi3hj3]T;So above-mentioned formula (10), formula (11) can be written asBring all homography matrixes intoValue, solves b, then solves each element value and outer ginseng in internal reference matrix A again;
(1.5) it is solved by Levenberg-Marquardt algorithm and minimizes projection error, Lai Youhua camera internal reference and outerGinseng;According to fast algorithm in the step 2), the pixel bigger with the difference value of the pixel in peripheral region is extractedAs key point;According to brief algorithm, the selected point pair around key point generates description by comparing pixel value.
Embodiment 2: should be specifically comprised the following steps: based on the method for the monocular vision measurement mileage of characteristics of image
1) according to gridiron pattern calibration algorithm, camera is demarcated, obtains camera internal reference;
2) calculate characteristics of image to two frame of front and back: construction image pyramid first extracts and peripheral region on every layerThe bigger pixel of the difference value of interior pixel is as key point;The selected point pair around key point, by comparing pixelValue generates description;Description is adjusted according to the angle of key point and gray scale mass center, so that description has invariable rotaryProperty;Finally obtain description of characteristics of image;
3) characteristic point on two frame of front and back is matched, obtains corresponding characteristic point: for the feature point set on imageEstablish k-d tree: selection has the dimension k of maximum variance in data set;Then select the value in k dimension for the spy of intermediate value mSign point is division node;Division by the value on dimension k less than m obtains left subspace, by the value on dimension k greater than m'sIt is divided into right subspace;Carry out aforesaid operations in left subspace and right subspace respectively, until cannot it is subdivided until, obtain k-D tree;Characteristic matching lookup is carried out with bbf searching algorithm: since the root node of k-d tree, binary search is carried out, by query pathOn node according to being respectively ranked up at a distance from query point;When being recalled, since the high tree node of priority, work as instituteWhen some nodes are all limited by inspection or beyond runing time, matched using the best result being currently found as arest neighbors specialSign point;
4) the 3D coordinate of matched characteristic point is calculated: according to the pixel size and physical size of an image, with an image left sideUpper angle be coordinate origin, using image taking to region establish coordinate system, the 3D coordinate of available characteristic point as plane;
5) according to the 3D coordinate of characteristic point and 2D coordinate, calculate camera after the picture is taken a frame when opposite former frame move away fromFrom;
6) pose of camera under all frames is successively calculated, displacement is obtained, obtains mileage.
As shown in Figure 1, using gridiron pattern calibration algorithm in the step 1), camera is demarcated, obtains camera internal referenceSpecifically includes the following steps:
(1.1) it according to national forest park in Xiaokeng, is closed by the transformation under image coordinate system, camera coordinates system, world coordinate systemSystem has:
(1.11) under world coordinate system, the coordinate of some point is [Xw, Yw, Zw], by under camera coordinates system, the anglePoint coordinate is [Xc, Yc, Zc], by rotating the correspondent transform relationship with translation,Wherein R is spin matrix, and T is the displacement of two coordinate origins, then has
(1.12) point is after camera imaging, and point is [x, y] in the coordinate system that image physical size indicates, according to similarTriangle relation hasWherein f is the focal length of camera, i.e.,
(1.13) shown in the relationship such as formula (3) of image pixel dimensions coordinate system and image physical size coordinate system, which existsThe coordinate system that image pixel dimensions indicate is [u, v], then has corresponding relationship:Wherein (u0, v0) it is image slicesPlain center, dxPhysical size for a pixel in x-axis direction, dyFor a pixel y-axis direction physical size to get
(1.14) in summary formula (1), formula (2), formula (3) relationship, can obtain:
(1.15) consider that degree of bias parameter C is added, finally have
(1.16) because gridiron pattern scaling board is plane, Z is setw=0, if A indicates camera matrix,r1, r2, r3For the column vector of R, t is translation column vector, then formula (5) can be written as
(1.2) homography matrix H is solved, shoots the gridiron pattern scaling board under multiple different perspectivess, and extract scaling board figureAs upper angle point.Tessellated size is it is known that so the pixel coordinate of angle point can be obtained with physical coordinates again.Pass through minimumSquare law, can be in the hope of the homography matrix H of all scaling board images.
(1.3) homography matrix H=[h1 h2 h3], according to formula (6), λ is enabled to indicate some constant, available [h1 h2h3]=λ A [r1 r2t]; (7)
If α, beta, gamma is respectively x-axis, y-axis, the rotation angle in z-axis direction, then spin matrixIt is availableAndTo obtain the final product | | r1| |=(cos γ cos β+sin γsinα sinβ)2+(-sinγ cosβ+cosγ sinα sinβ)2+(cosα sinβ)2=1, and | | r2| |=(sin γcosα)2+(cosγ cosα)2+(-sinα)2=1, so | | r1| |=| | r2| |=1. (8)
Calculate r1·r2=(cos γ cos β+sin γ sin α sin β) (sin γ cos α)+(- sin γ cos β+cosγ sin α sin β) (cos γ cos α)+(cos α sin β) (- sin α)=0, (9)
It is available according to above-mentioned formula (7), formula (8), formula (9):
Up to h1TA-TA-1h1=h2TA-TA-1h2。 (11)
(1.4) it solves inside and outside parameter: equation group being established according to above-mentioned formula (10), formula (11), will be obtained in step (1.2)Several groups of homography matrix values be brought into equation group, can solve to obtain internal reference matrix A;
It enablesIf hi=[hi1, hi2, hi3]T, then haveWherein b=[B11, B12, B22, B13, B23, B33]T, vij=[hi1hj1, hi1hj2+ hi2hj1, hi2hj2, hi3hj1+hi1hj3, hi3hj2+hi2hj3,hi3hj3]T;So above-mentioned formula (10), formula
(11) it can be written asThe value for bringing all homography matrixes into solves b, then asks againSolve each element value and outer ginseng in internal reference matrix A;
(1.5) it is solved by Levenberg-Marquardt algorithm and minimizes projection error, Lai Youhua camera internal reference and outerGinseng;According to fast algorithm in the step 2), the pixel bigger with the difference value of the pixel in peripheral region is extractedAs key point;According to brief algorithm, the selected point pair around key point generates description by comparing pixel value;It is describedStep 5), specifically includes the following steps: the camera internal reference obtained using step 1), characteristic point 3D coordinate obtained in step 4),And 2D pixel coordinate of the characteristic point in a later frame, can find out camera after the picture is taken a frame when pose, it is therein displacement pointAmount indicates displacement of the camera between shooting former frame and latter frame position;It is in the step 6) specifically includes the following steps: rightThe image that direction of advance takes be repeated in carry out step 2) to step 5) operation, successively by camera before and after shooting two framesWhen displacement component add up, obtain mileage.
Embodiment 3: should be specifically comprised the following steps: based on the method for the monocular vision measurement mileage of characteristics of image
1) according to gridiron pattern calibration algorithm, camera is demarcated, obtains camera internal reference;
2) calculate characteristics of image to two frame of front and back: construction image pyramid first extracts and peripheral region on every layerThe bigger pixel of the difference value of interior pixel is as key point;The selected point pair around key point, by comparing pixelValue generates description;Description is adjusted according to the angle of key point and gray scale mass center, so that description has invariable rotaryProperty;Finally obtain description of characteristics of image;
3) characteristic point on two frame of front and back is matched, obtains corresponding characteristic point: for the feature point set on imageEstablish k-d tree: selection has the dimension k of maximum variance in data set;Then select the value in k dimension for the spy of intermediate value mSign point is division node;Division by the value on dimension k less than m obtains left subspace, by the value on dimension k greater than m'sIt is divided into right subspace;Carry out aforesaid operations in left subspace and right subspace respectively, until cannot it is subdivided until, obtain k-D tree;Characteristic matching lookup is carried out with bbf searching algorithm: since the root node of k-d tree, binary search is carried out, by query pathOn node according to being respectively ranked up at a distance from query point;When being recalled, since the high tree node of priority, work as instituteWhen some nodes are all limited by inspection or beyond runing time, matched using the best result being currently found as arest neighbors specialSign point;
4) the 3D coordinate of matched characteristic point is calculated: according to the pixel size and physical size of an image, with an image left sideUpper angle be coordinate origin, using image taking to region establish coordinate system, the 3D coordinate of available characteristic point as plane;
5) according to the 3D coordinate of characteristic point and 2D coordinate, calculate camera after the picture is taken a frame when opposite former frame move away fromFrom;
6) pose of camera under all frames is successively calculated, displacement is obtained, obtains mileage.
As shown in Figure 1, using gridiron pattern calibration algorithm in the step 1), camera is demarcated, obtains camera internal referenceSpecifically includes the following steps:
(1.1) it according to national forest park in Xiaokeng, is closed by the transformation under image coordinate system, camera coordinates system, world coordinate systemSystem has:
(1.11) under world coordinate system, the coordinate of some point is [Xw, Yw, Zw], by under camera coordinates system, the anglePoint coordinate is [Xc, Yc, Zc], by rotating the correspondent transform relationship with translation,Wherein R is spin matrix, and T is the displacement of two coordinate origins, then has
(1.12) point is after camera imaging, and point is [x, y] in the coordinate system that image physical size indicates, according to similarTriangle relation hasWherein f is the focal length of camera, i.e.,
(1.13) shown in the relationship such as formula (3) of image pixel dimensions coordinate system and image physical size coordinate system, which existsThe coordinate system that image pixel dimensions indicate is [u, v], then has corresponding relationship:Wherein (u0, v0) it is image slicesPlain center, dxPhysical size for a pixel in x-axis direction, dyFor a pixel y-axis direction physical size to get
(1.14) in summary formula (1), formula (2), formula (3) relationship, can obtain:
(1.15) consider that degree of bias parameter C is added, finally have
(1.16) because gridiron pattern scaling board is plane, Z is setw=0, if A indicates camera matrix,r1, r2, r3For the column vector of R, t is translation column vector, then formula (5) can be written as
(1.2) homography matrix H is solved;The gridiron pattern scaling board under multiple different perspectivess is shot, and extracts scaling board figureAs upper angle point, and tessellated size passes through minimum it is known that so the pixel coordinate of angle point can be obtained with physical coordinatesSquare law, can be in the hope of the homography matrix H of all scaling board images;
(1.3) homography matrix H=[h1 h2 h3], according to formula (6), λ is enabled to indicate some constant, available [h1 h2h3]=λ A [r1 r2t]; (7)
If α, beta, gamma is respectively x-axis, y-axis, the rotation angle in z-axis direction, then spin matrixIt is availableAndTo obtain the final product | | r1| |=(cos γ cos β+sin γsinα sinβ)2+(-sinγ cosβ+cosγ sinα sinβ)2+(cosα sinβ)2=1, and | | r2| |=(sin γcosα)2+(cosγ cosα)2+(-sinα)2=1, so | | r1| |=| | r2| |=1 (8)
Calculate r1·r2=(cos γ cos β+sin γ sin α sin β) (sin γ cos α)+(- sin γ cos β+cosγ sin α sin β) (cos γ cos α)+(cos α sin β) (- sin α)=0, (9)
It is available according to above-mentioned formula (7), formula (8), formula (9):
Up to h1TA-TA-1h1=h2TA-TA-1h2 (11)
(1.4) it solves inside and outside parameter: equation group being established according to above-mentioned formula (10), formula (11), will be obtained in step (1.2)Several groups of homography matrix values be brought into equation group, can solve to obtain internal reference matrix A;
It enablesIf hi=[hi1, hi2, hi3]T, then haveWherein b=[B11, B12, B22, B13, B23, B33]T, vij=[hi1hj1, hi1hj2+ hi2hj1, hi2hj2, hi3hj1+hi1hj3, hi3hj2+hi2hj3,hi3hj3]T;So above-mentioned formula (10), formula (11) can be written asBring all homography matrixes intoValue, solves b, then solves each element value and outer ginseng in internal reference matrix A again;
(1.5) it is solved by Levenberg-Marquardt algorithm and minimizes projection error, Lai Youhua camera internal reference and outerGinseng;According to fast algorithm in the step 2), the pixel bigger with the difference value of the pixel in peripheral region is extractedAs key point;According to brief algorithm, the selected point pair around key point generates description by comparing pixel value;It is describedStep 5), specifically includes the following steps: the camera internal reference obtained using step 1), characteristic point 3D coordinate obtained in step 4),And 2D pixel coordinate of the characteristic point in a later frame, can find out camera after the picture is taken a frame when pose, it is therein displacement pointAmount indicates displacement of the camera between shooting former frame and latter frame position;It is in the step 6) specifically includes the following steps: rightThe image that direction of advance takes be repeated in carry out step 2) to step 5) operation, successively by camera before and after shooting two framesWhen displacement component add up, obtain mileage;The method of the monocular vision measurement mileage based on characteristics of image is used for tunnelThe monocular vision odometer of characteristics of image in detection;With feature testing result the most significant in target in the step (3)As the primary condition of characteristic matching, determine target encoded surface visual in visual field, and as original state, start intoRow characteristic matching.
Embodiment 4
A kind of monocular vision odometer based on characteristics of image carries in the vehicle-mounted detection platform of Tunnel testingProgram used the method in Examples 1 to 3.
The following table is six parameter of pose of monocular vision measurement camera:
Six parameter of pose of 1 monocular vision of table measurement camera
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to restrict the invention, all in essence of the inventionWithin mind and principle, any modification, equivalent substitution, improvement and etc. done be should all be included in the protection scope of the present invention.