Summary of the invention
In view of this, the purpose of this invention is to provide automatic bearing calibration of 3D camera image and system, need not specific demarcation thing and people's intervention, can the image of real-time shooting be carried out from NMO correction.
For there is a basic understanding some aspects to the embodiment that discloses, provided simple summary below.This summary part is not to comment general, neither confirm the key/critical component or describe the protection domain of these embodiment.Its sole purpose is to present some notions with simple form, with this preamble as the detailed description of back.
Technical scheme of the present invention is achieved in that
The automatic method of correcting of a kind of 3D camera image, said 3D camera comprise first camera and second camera that synchronous execution is taken; Set initial correction parameter; This method also comprises:
Gather the image that first camera and second camera are taken;
Use correction parameter that two width of cloth images that collect are proofreaied and correct;
When two width of cloth images after judgement is proofreaied and correct do not reach established standards, utilize two width of cloth images that collect to carry out from demarcating;
Utilize said result to upgrade correction parameter, continue to carry out the step of said collection then from demarcation.
Optional, use correction parameter that two width of cloth images that collect are proofreaied and correct, comprising:
Image to first camera that collects is taken uses the inner parameter of first camera and distortion factor to carry out distortion correction;
To the image that second camera that collects is taken, use the inner parameter and the distortion factor of second camera to carry out distortion correction earlier, re-use said external parameter and be rotated translation.
Optional, judge that whether two width of cloth images after proofreading and correct reach the method for established standards, comprising:
The corresponding parallax of each pixel in two width of cloth images behind the calculation correction;
Whether the number percent of judging correct parallax in all parallaxes that calculate reaches setting threshold, if, judge that two width of cloth images after proofreading and correct reach established standards, otherwise, judge that two width of cloth images after proofreading and correct do not reach established standards.
Optional, utilize two width of cloth images that collect to carry out comprising from demarcating:
Two width of cloth images that utilization collects carry out the demarcating certainly of inner parameter and distortion factor, and the inner parameter of second camera and the demarcation certainly of distortion factor of first camera;
Two width of cloth images that utilization collects carry out the demarcation certainly of external parameter.
Optional, two width of cloth images that said utilization collects carry out the demarcation certainly of external parameter, comprising:
Utilize from inner parameter and the distortion factor of demarcating first camera that obtains; The image that first camera that collects is taken carries out distortion correction; And utilize from inner parameter and the distortion factor of demarcating second camera that obtains, the image that second camera that collects is taken carries out distortion correction;
Two width of cloth images to behind the distortion correction carry out Feature Points Matching;
Unique point is mapped to the normalization plane;
Calculate essential matrix, and utilize essential matrix to obtain external parameter.
A kind of 3D camera image is from the device of NMO correction, and said 3D camera comprises first camera and second camera that synchronous execution is taken; This device comprises:
The correction parameter module is used for the correction parameter of storing initial;
Image capture module is used to gather the image of first camera and the shooting of second camera;
Automatically correction module is used for using the correction parameter of said correction parameter module that two width of cloth images that collect are proofreaied and correct;
The correcting result evaluation module is used to judge whether two width of cloth images after the correction reach established standards;
From demarcating module, when being used for two width of cloth images after correction and not reaching established standards, utilize two width of cloth images that collect to carry out from demarcating;
Update module is used for utilizing the correction parameter that upgrades said correction parameter module from the result who demarcates.
Optional, said automatic correction module comprises:
The first automatic syndrome module is used for the image to first camera shooting that collects, and uses the inner parameter of first camera and distortion factor to carry out distortion correction;
The second automatic syndrome module is used for the image to second camera shooting that collects, and uses the inner parameter and the distortion factor of second camera to carry out distortion correction earlier, re-uses said external parameter and is rotated translation.
Optional, said correcting result evaluation module comprises:
Calculating sub module is used for the corresponding parallax of each pixel of two width of cloth images behind the calculation correction;
Estimate submodule, be used for judging whether the number percent of the correct parallax of all parallaxes that calculate reaches setting threshold, if, judge that two width of cloth images after proofreading and correct reach established standards, otherwise, judge that two width of cloth images after proofreading and correct do not reach established standards.
Optional, saidly comprise from demarcating module:
First from demarcating submodule, be used to utilize two width of cloth images that collect carry out first camera inner parameter and distortion factor demarcate, reach the inner parameter of second camera and the demarcation certainly of distortion factor certainly;
Second from demarcating submodule, is used to utilize two width of cloth images that collect to carry out the demarcation certainly of external parameter.
Optional, said second comprises from demarcating module:
The distortion correction unit; Be used to utilize inner parameter and distortion factor from demarcating first camera that obtains; The image that first camera that collects is taken carries out distortion correction; And utilize from inner parameter and the distortion factor of demarcating second camera that obtains, the image that second camera that collects is taken carries out distortion correction;
Computing unit is used for two width of cloth images behind the distortion correction are carried out Feature Points Matching; Unique point is mapped to the normalization plane; Calculate essential matrix, and utilize essential matrix to obtain external parameter.
It is thus clear that; In automatic method of correcting of 3D camera image of the present invention and the device, proofread and correct according to two width of cloth images of real-time collection, and correcting result is carried out automatic Evaluation; When correcting result is not up to standard, utilize two width of cloth images of gathering to carry out demarcating certainly and upgrading correction parameter; Whole process does not need people's intervention fully, and is simple and convenient concerning the user, quick accurate and anti-interference concerning system.
For above-mentioned and relevant purpose, one or more embodiment comprise the characteristic that the back will specify and in claim, particularly point out.Below explanation and accompanying drawing specify some illustrative aspects, and its indication only is some modes in the utilizable variety of way of principle of each embodiment.Other benefit and novel features will consider and become obviously along with following detailed description combine accompanying drawing, and the disclosed embodiments are to comprise being equal to of all these aspects and they.
Figure of description
Fig. 1 is the process flow diagram of the automatic bearing calibration of 3D camera image among the present invention;
Fig. 2 is the process flow diagram of the automatic bearing calibration of 3D camera image in the embodiment of the invention;
Fig. 3 a is the schematic diagram of parallel binocular vision range sensor measuring distance with Fig. 3 b;
Fig. 4 is the apparatus structure synoptic diagram of the automatic bearing calibration of 3D camera image among the present invention;
Fig. 5 is the apparatus structure synoptic diagram of the automatic bearing calibration of 3D camera image in the embodiment of the invention.
Embodiment
Below description and accompanying drawing illustrate specific embodiments of the present invention fully, to enable those skilled in the art to put into practice them.Other embodiments can comprise structure, logic, electric, process and other change.Embodiment only represents possible variation.Only if explicitly call for, otherwise independent assembly and function are optional, and the order of operation can change.The part of some embodiments and characteristic can be included in or replace the part and the characteristic of other embodiments.The scope of embodiment of the present invention comprises the gamut of claims, and all obtainable equivalents of claims.In this article; These embodiments of the present invention can be represented with term " invention " individually or always; This only is for ease, and if in fact disclose and surpass one invention, not that the scope that will automatically limit this application is any single invention or inventive concept.
Related 3D camera among the present invention comprises first camera and second camera that synchronous execution is taken.
Fig. 1 before this flow process begins, sets initial correction parameter for the process flow diagram of the automatic method of correcting of 3D camera image of the present invention.
Flow process shown in Figure 1 comprises:
Step 11: gather the image that first camera and second camera are taken.
Step 12: use correction parameter that two width of cloth images that collect are proofreaied and correct.
Step 13: when two width of cloth images after judgement is proofreaied and correct do not reach established standards, utilize two width of cloth images that collect to carry out from demarcating.
Step 14: the result according to demarcating certainly upgrades correction parameter, continues execution in step 11 then.
It is thus clear that; In the automatic method of correcting of 3D camera image of the present invention, proofread and correct according to two width of cloth images of real-time collection, and correcting result is carried out automatic Evaluation; When correcting result is not up to standard, utilize two width of cloth images of gathering to carry out demarcating certainly and upgrading correction parameter; Whole process does not need people's intervention fully, and is simple and convenient concerning the user, quick accurate and anti-interference concerning system.
Provide the embodiment of the inventive method below, comprise that with the 3D camera binocular camera shooting head is an example, be called left camera and right camera respectively in below describing.Above-mentioned left camera and right camera can move, and carry out continuously synchronously and take, and therefore left camera and right camera can obtain the multiple image of different visual angles to same scenery.
In the present embodiment, second width of cloth image of taking from left camera and right camera begins, each width of cloth image is all carried out the flow process from NMO correction.
In the present embodiment, set initial correction parameter, concrete, set left camera and have identical inner parameter and distortion factor with right camera.Initial correction parameter specifically comprises following several:
1) initial inner parameter.
Equivalent focal length:
,
.
Above
and
, respectively, for the left and right camera camera shooting out of the image's width and height.
2) initial distortion factor.
3) initial external parameter.
More than the setting result of initial correction parameter be merely a kind of for example.
Fig. 2 is the process flow diagram of the automatic method of correcting of 3D camera image in the embodiment of the invention, and this flow process comprises:
Step 21: gather the image that left camera and right camera are taken.
The image that the left camera that collects is taken is designated as ImageL, and the image that the right camera that collects is taken is designated as ImageR.
Step 22: the image to the left camera that collects is taken, use the inner parameter of left camera and distortion factor to carry out distortion correction.
In this step, if current be for the first time to carry out distortion correction, uses initial correction parameter, otherwise uses the correction parameter after the last renewal.
If ImageL is ImageL ' behind the distortion correction, the pixel among the ImageL '
Dst(
J, i), the correspondence position of this pixel in ImageL
Src(
X, y), to (5), can calculate each through following formula (1)
Dst(
J, i) the coordinate of correspondence position in ImageL.
Step 23: to the image that the right camera that collects is taken, use the inner parameter and the distortion factor of right camera to carry out distortion correction earlier, re-use external parameter and be rotated translation.
In this step; At first adopt formula (1) to formula (5) to calculate the coordinate after each pixel among the ImageR carries out distortion correction; And further obtain the ImageR behind the distortion correction; Be designated as Image ', and then keep ImageL ' constant, and use external parameter that ImageR ' is rotated translation.Also can keep ImageR ' constant, and use external parameter that ImageL ' is rotated translation.
If the ImageR ' after the rotation translation is ImageR ' ', the pixel among the ImageR ' '
DstR(
J, i), the correspondence position in ImageR '
SrcR(
X, y), can calculate each through following formula (6) to formula (9)
DstR(
J, i) coordinate of correspondence position in ImageR '.
The equivalent focal length of
in above-mentioned formula (6) to the formula (9) and the right camera of
representative,
and
is the central point of right camera.
Step 24: judge whether two width of cloth images after proofreading and correct reach established standards, if, continue execution in step 21, otherwise, execution in step 25.
This step is based on realizing with the parallel binocular vision range sensor principle shown in Fig. 3 b like Fig. 3 a.
Fig. 3 a is the schematic diagram of parallel binocular vision range sensor measuring distance with Fig. 3 b, and wherein Fig. 3 b is a vertical view.Two focal lengths do
fThe parallel placement of video camera, the distance between the optical axis does
T, two rectangles among Fig. 3 a are represented the imaging plane of left and right cameras respectively,
O l With
O r Be the focus of left and right cameras, suppose that operator's the gesture of choosing is in this scene
PPoint, the imaging point on the left and right cameras imaging plane is respectively
p l With
p r , their imager coordinates on imaging plane do
x l With
x r , will
d=
x l -
x r Be defined as parallax.
True coordinate system in the present embodiment is with the intersection point of left video camera
O l Be initial point,
O l With
O r The place straight line does
XAxle, the optical axis of left video camera does
ZAxle, perpendicular to
XZDoing of axle
YAxle, then
PThe point and the distance of video camera, promptly
PThe coordinate of point in true coordinate system calculates according to following formula:
In this step; At first calculate the corresponding parallax of each pixel among ImageL ' and the ImageR ' '; Specifically can use based on the Algorithm of Parallax (block-matching stereo correspondence algorithm) of piece coupling or based on existing computing method such as the minimized Algorithm of Parallax of energy function (graph cuts-based stereo correspondence algorithm) and realize, repeat no more here.
Then, adopt a kind of in the following dual mode, judge whether the corresponding parallax of this pixel is correct parallax to each pixel.
1) be example with a pixel A among the ImageL '; Suppose 2nd row 10th row of A in ImageL '; In ImageR ' ', search a pixel the most approaching with the A pixel value; If the pixel that finds also at the 2nd row the 10th row, confirms that then the parallax of A is correct parallax in ImageR ' '.
2), can know
based on principle shown in Figure 3.A pixel A with among the ImageL ' is an example, and the parallax
that utilizes A to calculate calculates corresponding
.Utilize laser sensor to measure actual
value then.If actual
is worth and
value of calculating equates that then the parallax of definite A is correct parallax.
At last, the ratio of correct parallax if this ratio reaches preset threshold, thinks that then ImageL ' and ImageR ' ' reach established standards in all parallaxes that statistical computation goes out.
Step 25: utilize two width of cloth images that collect to carry out the demarcation certainly of the inner parameter and the distortion factor of left camera and right camera respectively.
With the inner parameter of left camera and the demarcation certainly of distortion factor is example, mainly comprises the steps:
Step 1: utilize feature extracting method (sift) or other existing algorithms extract minutiae from ImageL based on the conversion of yardstick invariant features; And utilize multidimensional trie tree (KD_tree) algorithm to obtain match point set
,
of the ImageL at a current I mageL and a last visual angle; Wherein the point in
is designated as
, and the point in
is designated as
.
Step 2: calculate fundamental matrix
through following formula (10).
Step 3: calculate outer limit
through following formula (11).
Step 4: find the solution the Kruppa equation, obtain
.(12)
Step 5: Decomposition
get internal parameters
.
Step 6: utilize the Zhang Zhengyou two-step approach, calculate distortion factor.
The inner parameter of right camera is also identical with the self-calibrating method of distortion factor, repeats no more here.
Step 26: utilize two width of cloth images that collect to carry out the demarcation certainly of external parameter.
External parameter in this step mainly comprises the steps: from demarcating
Step 1: utilize the inner parameter and the distortion factor of the left camera that obtains in the step 25, ImageL is carried out distortion correction, and utilize the inner parameter and the distortion factor of the right camera that obtains in the step 25, ImageR is carried out distortion correction.
Step 2: utilize feature extracting method (surf) algorithm of sift algorithm, fast robust or other existing algorithms respectively ImageL behind the distortion correction and ImageR to be carried out feature point extraction; And the unique point that the ImageL after utilizing the KD_tree algorithm to distortion correction and ImageR extract matees, and forms set
and
.
Step 3: by the following equation (12) will be
and
maps to the normalized plane.
Step 4: the group of solving an equation
, calculate essential matrix
.
Step 5:, calculate rotation matrix
and translation matrix
through following formula (13) and (14).
Wherein, antisymmetric matrix
.
Can find out, in the present embodiment in calibration process, respectively inner parameter and external parameter are demarcated, can select all to carry out the demarcation certainly of inner parameter and distortion factor according to actual conditions so whether at every turn.For example, concerning the camera of some non-zooms, can all carry out the demarcation certainly of inner parameter and distortion factor at every turn.
Step 27: the result according to demarcating certainly upgrades correction parameter, and execution in step 21 then.
After upgrading correction parameter; Follow-up execution in step 22 is during with step 23, with the correction parameter that uses after upgrading, if the image after the correction that obtains based on the correction parameter after upgrading does not reach established standards; To carry out according to step 25 to step 27 pair correction parameter once more and upgrade so circulation.
Fig. 4 is the structural representation of 3D camera image of the present invention from the device of NMO correction, and the 3D camera comprises first camera and second camera that synchronous execution is taken.
Device shown in Figure 4 comprises: correction parameter module 41, image capture module 42, automatically correction module 43, correcting result evaluation module 44, from demarcating module 45 and update module 46.
Correction parameter module 41 is used for the correction parameter of storing initial.
Image capture module 42 is used to gather the image of first camera and the shooting of second camera.
Automatically correction module 43 is used for using the correction parameter of correction parameter module 41 that two width of cloth images that collect are proofreaied and correct.
Correcting result evaluation module 44 is used to judge whether two width of cloth images after the correction reach established standards.
From demarcating module 45, when being used for two width of cloth images after correction and not reaching established standards, utilize two width of cloth images that collect to carry out from demarcating.
Update module 46 is used for utilizing the correction parameter that upgrades correction parameter module 41 from the result who demarcates.
It is thus clear that; 3D camera image of the present invention is proofreaied and correct according to two width of cloth images of real-time collection, and correcting result is carried out automatic Evaluation in the device of NMO correction; When correcting result is not up to standard, utilize two width of cloth images of gathering to carry out demarcating certainly and upgrading correction parameter; Whole process does not need people's intervention fully, and is simple and convenient concerning the user, quick accurate and anti-interference concerning system.
Provide the embodiment of apparatus of the present invention below.
Fig. 5 is that the 3D camera image is from the structural representation of the device of NMO correction in the embodiment of the invention, and this device comprises: correction parameter module 51, image capture module 52, automatically correction module 53, correcting result evaluation module 54, from demarcating module 55 and update module 56.
Correction parameter module 51 is used for the correction parameter of storing initial.
Image capture module 52 is used to gather the image of first camera and the shooting of second camera.
Automatically correction module 53 comprises: the first automatic syndrome module 531 and the second automatic syndrome module 532.
The first automatic syndrome module 531 is used for the image to first camera shooting that collects, and uses the inner parameter of first camera and distortion factor to carry out distortion correction.
The second automatic syndrome module 532 is used for the image to second camera shooting that collects, and uses the inner parameter and the distortion factor of second camera to carry out distortion correction earlier, re-uses said external parameter and is rotated translation.
Correcting result evaluation module 54 comprises: calculating sub module 541 and evaluation submodule 542.
Calculating sub module 541 is used for the corresponding parallax of each pixel of two width of cloth images behind the calculation correction.
Estimate submodule 542, be used for judging whether the number percent of the correct parallax of all parallaxes that calculate reaches setting threshold, if, judge that two width of cloth images after proofreading and correct reach established standards, otherwise, judge that two width of cloth images after proofreading and correct do not reach established standards.
Comprise from demarcating module 55: first from demarcating submodule 551 and second from demarcating submodule 552.
First from demarcating submodule 551, be used to utilize two width of cloth images that collect carry out first camera inner parameter and distortion factor demarcate, reach the inner parameter of second camera and the demarcation certainly of distortion factor certainly.
Second from demarcating submodule 552, is used to utilize two width of cloth images that collect to carry out the demarcation certainly of external parameter.Second demarcates submodule 552 certainly can comprise: the distortion correction unit; Be used to utilize inner parameter and distortion factor from demarcating first camera that obtains; The image that first camera that collects is taken carries out distortion correction; And utilize from inner parameter and the distortion factor of demarcating second camera that obtains, the image that second camera that collects is taken carries out distortion correction; Computing unit is used for two width of cloth images behind the distortion correction are carried out Feature Points Matching; Unique point is mapped to the normalization plane; Calculate essential matrix, and utilize essential matrix to obtain external parameter.
Update module 56 is used for utilizing the correction parameter that upgrades correction parameter module 51 from the result who demarcates.
Can find out that the device in the present embodiment is demarcated inner parameter and external parameter respectively in calibration process, can select all to carry out the demarcation certainly of inner parameter and distortion factor according to actual conditions so whether at every turn.For example, concerning the camera of some non-zooms, can all carry out the demarcation certainly of inner parameter and distortion factor at every turn.
Device in the embodiment of the invention can be according to the method executable operations in the embodiment of the invention.
It will be appreciated by those skilled in the art that the particular order of the step in the above disclosed process or the instance that level is illustrative methods.Based on design preference, should be appreciated that the particular order of the step in the process or level can be rearranged under the situation that does not break away from protection domain of the present disclosure.Appended claim to a method has provided the key element of various steps with exemplary order, and is not to be limited to described particular order or level.
Those skilled in the art it is also understood that various illustrative box, module and the algorithm steps of the embodiment description that combines this paper all can be embodied as electronic hardware, computer software or its combination.For the interchangeability between the hardware and software clearly is described, above various illustrative parts, frame, module, circuit and step have all been carried out usually describing around its function.Be embodied as hardware or be embodied as software as for this function, depend on certain applications and design constraint that total system applied.Those skilled in the art can be directed against each application-specific, realize described function with the mode of accommodation, and still, this realization decision-making should not be construed as and deviates from protection domain of the present disclosure.
For making any technician in this area can realize or use the present invention, above disclosed embodiment is described.To those skilled in the art, the various alter modes of these embodiment all are conspicuous, and the General Principle of this paper definition also can be applicable to other embodiment on the basis that does not break away from spirit of the present disclosure and protection domain.Therefore, the disclosure is not limited to the embodiment that this paper provides, but consistent with the widest scope of disclosed principle of the application and novel features.