Binocular camera resetting method and binocular camera resetting apparatus
Abstract
The present invention provides a binocular camera resetting method and a binocular camera resetting apparatus, wherein the binocular camera resetting method comprises: obtaining a first image and a second image photographed by two cameras at the same time respectively after completing a rough adjustment of the two cameras; calculating a relative rotation angle between optical axes of the two cameras using a plurality of feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras; controlling one of the two cameras to rotate the relative rotation angle to parallelize the optical axes of the rotated camera and the other camera; and adjusting a spaced distance between the two cameras to a preset distance.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A binocular camera resetting method, comprising:
obtaining a first image and a second image photographed by two cameras at the same time respectively after completing a rough adjustment of the two cameras;
calculating a relative rotation angle between optical axes of the two cameras using a plurality of feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras;
controlling one of the two cameras to rotate the relative rotation angle to parallelize the optical axes of the rotated camera and the other camera; and
adjusting a spaced distance between the two cameras to a preset distance in order to ensure that the two cameras are at a preset original position after parallelizing the optical axes of the two cameras,
wherein calculating the relative rotation angle between optical axes of the two cameras using the feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras, further comprises:
detecting a plurality of feature points of the first image and a plurality of feature points of the second image, respectively;
matching the feature points of the first image and the feature points of the second image to obtain a plurality of feature point matching pairs; and
calculating the relative rotation angle according to the feature point matching pairs,
wherein calculating the relative rotation angle according to the feature point matching pairs comprises:
calculating a rotation matrix of the two cameras whenever N feature point matching pairs are selected, wherein N is a positive integer greater than or equals to 8;
calculating an amount of outlier matching pairs corresponding to each rotation matrix; selecting the rotation matrix with least amount of outlier matching pairs as a finally determined rotation matrix of the two cameras; and
calculating a rotation angle on the x-axis, y-axis, and z-axis which the camera should be rotated relating to the other camera according to the finally determined rotation matrix.
2. A binocular camera resetting method, comprising:
obtaining a first image and a second image photographed by two cameras at the same time respectively after completing a rough adjustment of the two cameras;
calculating a relative rotation angle between optical axes of the two cameras using a plurality of feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras;
controlling one of the two cameras to rotate the relative rotation angle to parallelize the optical axes of the rotated camera and the other camera; and
adjusting a spaced distance between the two cameras to a preset distance in order to ensure that the two cameras are at a preset original position after parallelizing the optical axes of the two cameras,
wherein adjusting the spaced distance between the two cameras to the preset distance comprises:
obtaining a corresponding relationship between an image horizontal parallax and the spaced distance between the two cameras;
determining the spaced distance now between the two cameras according to the corresponding relationship and the image horizontal parallax now between the two cameras; and
deciding whether the determined spaced distance between the two cameras corresponds to the preset distance between the two cameras when the two cameras are at the preset original position; if not, adjusting the spaced distance between the two cameras,
wherein obtaining the corresponding relationship between the image horizontal parallax and the spaced distance between the two cameras comprises:
photographing a left image and a right image by the two cameras respectively at a first time when the optical axes of the two cameras are parallel, and calculating a first average parallax between the left image and the right image at the first time;
controlling one of the two cameras to move a unit length in order to photograph the left image and the right image by the two cameras respectively at a second time, and calculating a second average parallax between the left image and the right image at the second time; and
obtaining the corresponding relationship according to relationship between an average parallax difference and the unit length, wherein the average parallax difference is difference between the first average parallax and the second average parallax.
3. The binocular camera resetting method according to claim 2 , wherein calculating average parallax between the left image and the right image comprises:
detecting a plurality of feature points of the left image and the right image at the first time, matching the feature points of the left image and the feature points of the right image to obtain a plurality of matching pairs, and calculating a parallax of each matched pairs to obtain the first average parallax at the first time; and
detecting a plurality of feature points of the left image and the right image at the second time, matching the feature points of the left image and the feature points of the right image to obtain a plurality of matching pairs_at the second time, and calculating a parallax of each matched pairs at the second time to obtain the second average parallax at the second time;
wherein the parallax of the corresponded matching pair is errorless and the first average parallax and the second average parallax are calculated according to the errorless parallax by satisfying the following condition:
the feature points of the left image at the first time are matched with the feature points of the left image at the second time, or the feature points of the right image at the first time are matched with the feature points of the right image at the second time.
4. A binocular camera resetting apparatus, which is characterized in comprising:
a processor, connecting to a controller, and obtaining a first image and a second image photographed by two cameras at the same time respectively after a rough adjustment of the two cameras is completed, calculating a relative rotation angle between the two cameras using a plurality of feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras and sending an angle control command to the controller, and obtaining a spaced distance between the two cameras and sending a distance control command to the controller;
the controller, connecting to two driving units, and sending the angle control command to the two driving units while receiving the angle control command, and sending the distance control command to the two driving units while receiving the distance control command; and
the two driving unit, connecting to the two cameras respectively, and controlling one of the two cameras to rotate the relative rotation angle to parallelize the optical axes of the rotated camera and the other camera while receiving the angle control command, and, while receiving the distance control command, adjusting a spaced distance between the two cameras to a preset distance in order to ensure that the two cameras are at a preset original position,
wherein the processor comprises:
a corresponding relationship obtaining unit for obtaining a corresponding relationship between an image horizontal parallax and the spaced distance between the two cameras;
a distance calculating unit for determining the spaced distance now between the two cameras according to the corresponding relationship and the image horizontal parallax now between the two cameras; and
a decision unit for deciding whether the determined spaced distance between the two cameras corresponds to the preset distance between the two cameras when the two cameras are at the preset original position; if not, adjusting the spaced distance between the two cameras,
wherein the corresponding relationship obtaining unit comprises:
a first average parallax calculating subunit for photographing a left image and a right image by the two cameras respectively at a first time when the optical axes of the two cameras are parallel, and calculating a first average parallax between the left image and the right image at the first time;
a second average parallax calculating subunit for controlling one of the two cameras to move a unit length in order to photograph the left image and the right image by the two cameras respectively at a second time, and calculating a second average parallax between the left image and the right image at the second time; and
a corresponding relationship calculating subunit for obtaining the corresponding relationship according to relationship between an average parallax difference and the unit length, wherein the average parallax difference is difference between the first average parallax and the second average parallax.
5. The binocular camera resetting apparatus according to claim 4 , wherein the corresponding relationship obtaining unit comprises:
a first parallax calculating unit for detecting a plurality of feature points of the left image and the right image at the first time, matching the feature points of the left image and the feature points of the right image to obtain a plurality of matching pairs, and calculating a parallax of each matched pairs to obtain the first average parallax at the first time; and
a second parallax calculating unit for detecting a plurality of feature points of the left image and the right image at the second time, matching the feature points of the left image and the feature points of the right image to obtain a plurality of matching pairs at the second time, and calculating a parallax of each matched pairs at the second time to obtain the second average parallax at the second time;
wherein the processor further comprises a checking unit wherein the checking unit is charged to ensure that the parallax of the corresponded matching pair is errorless and the first average parallax and the second average parallax are calculated according to the errorless parallax by satisfying the following condition:
the feature points of the left image at the first time are matched with the feature points of the left image at the second time, or the feature points of the right image at the first time are matched with the feature points of the right image at the second time.
6. The binocular camera resetting method according to claim 1 , wherein detecting the feature points of the first image and the feature points of the second image comprises:
calculating a pixel feature score of each pixel in each of the images; and
selecting a predetermined amount of pixels each with pixel feature score greater than a threshold to be the feature points of each of the images;
wherein matching the feature points of the first image and the feature points of the second image comprises:
matching each of the feature points of the first image with all the feature points in neighborhood of a position in the second image the same as the position where the matching feature point of the first image is; and
selecting two feature points having a highest matching score as one of the feature point matching pairs.
7. The binocular camera resetting method according to claim 1 , wherein adjusting the spaced distance between the two cameras to the preset distance comprises:
obtaining a corresponding relationship between an image horizontal parallax and the spaced distance between the two cameras;
determining the spaced distance now between the two cameras according to the corresponding relationship and the image horizontal parallax now between the two cameras; and
deciding whether the determined spaced distance between the two cameras corresponds to the preset distance between the two cameras when the two cameras are at the preset original position; if not, adjusting the spaced distance between the two cameras.
8. The binocular camera resetting method according to claim 1 , wherein completing the rough adjustment of the two cameras comprises:
driving the two cameras to corresponding original positions respectively while receiving a reset command; and
driving the two cameras to rotate a preset angle and to move the preset distance in opposite direction respectively after the two cameras reach the corresponding original positions respectively.
9. The binocular camera resetting method according to claim 2 , wherein calculating the relative rotation angle between optical axes of the two cameras using the feature points of the first image acquired by one of the two cameras and the feature points of the second image acquired by the other one of the two cameras, further comprises:
detecting a plurality of feature points of the first image and a plurality of feature points of the second image, respectively;
matching the feature points of the first image and the feature points of the second image to obtain a plurality of feature point matching pairs; and
calculating the relative rotation angle according to the feature point matching pairs.
10. The binocular camera resetting method according to claim 9 , wherein detecting the feature points of the first image and the feature points of the second image comprises:
calculating a pixel feature score of each pixel in each of the images; and
selecting a predetermined amount of pixels each with pixel feature score greater than a threshold to be the feature points of each of the images; wherein matching the feature points of the first image and the feature points of the second image comprises:
matching each of the feature points of the first image with all the feature points in neighborhood of a position in the second image the same as the position where the matching feature point of the first image is; and
selecting two feature points having a highest matching score as one of the feature point matching pairs.
11. The binocular camera resetting method according to claim 9 , wherein calculating the relative rotation angle according to the feature point matching pairs comprises:
calculating a rotation matrix of the two cameras whenever N feature point matching pairs are selected, wherein N is a positive integer greater than or equals to 8;
calculating an amount of outlier matching pairs corresponding to each rotation matrix; selecting the rotation matrix with least amount of outlier matching pairs as a finally determined rotation matrix of the two cameras; and
calculating a rotation angle on the x-axis, y-axis, and z-axis which the camera should be rotated relating to the other camera according to the finally determined rotation matrix.
12. The binocular camera resetting method according to claim 2 , wherein completing the rough adjustment of the two cameras comprises:
driving the two cameras to corresponding original positions respectively while receiving a reset command; and
driving the two cameras to rotate a preset angle and to move the preset distance in opposite direction respectively after the two cameras reach the corresponding original positions respectively.
13. The binocular camera resetting apparatus according to claim 4 , wherein the processor comprises:
a feature point detecting unit for detecting a plurality of feature points of the first image and a plurality of feature points of the second image, respectively;
a matching pair obtaining unit for matching the feature points of the first image and the feature points of the second image to obtain a plurality of feature point matching pairs; and
an angle calculating unit for calculating the relative rotation angle according to the feature point matching pairs.
14. The binocular camera resetting apparatus according to claim 13 , wherein the feature point detecting unit comprises:
a pixel feature score calculating subunit and a feature selecting subunit, wherein the pixel feature score calculating subunit calculates a pixel feature score of each pixel in each of the images, and the feature selecting subunit selects a predetermined amount of pixels each with pixel feature score greater than a threshold to be the feature points of each of the images; and
the matching pair obtaining unit comprises a matching subunit for matching each of the feature points of the first image with all the feature points in neighborhood of a position in the second image the same as the position where the matching feature point of the first image is, and selecting two feature points having a highest matching score as one of the feature point matching pairs.
15. The binocular camera resetting apparatus according to claim 13 , wherein the angle calculating unit comprises:
a rotation matrix calculating subunit for calculating a rotation matrix of the two cameras whenever N feature point matching pairs are selected, and calculating an amount of outlier matching pairs corresponding to each rotation matrix and selecting the rotation matrix with least amount of outlier matching pairs as a finally determined rotation matrix of the two cameras; and
a rotation angle calculating subunit for calculating a rotation angle on the x-axis, y-axis, and z-axis which the camera should be rotated relating to the other camera according to the finally determined rotation matrix, wherein N is a positive integer greater than or equals to 8.
16. The binocular camera resetting apparatus according to claim 4 , wherein the processor further sends a reset command to the controller while receiving a triggering signal of a reset switch;
the controller further sends a third control signal to the two driving units while receiving the reset command;
each of the driving units further drives the corresponding camera for completing the rough adjustment while receiving the third control signal;
wherein each of the driving unit comprises:
a first driving motor for driving the two cameras to corresponding original positions respectively while receiving a reset command, and driving the two cameras to move the preset distance in opposite direction respectively after the two cameras reach the corresponding original positions respectively; and
a second driving motor for driving the two cameras to rotate a preset angle after the two cameras reach the corresponding original positions respectively.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.