WO2017008516A1 - 双摄像头相对位置计算方法、装置和设备 - Google Patents

双摄像头相对位置计算方法、装置和设备 Download PDF

Info

Publication number
WO2017008516A1
WO2017008516A1 PCT/CN2016/075949 CN2016075949W WO2017008516A1 WO 2017008516 A1 WO2017008516 A1 WO 2017008516A1 CN 2016075949 W CN2016075949 W CN 2016075949W WO 2017008516 A1 WO2017008516 A1 WO 2017008516A1
Authority
WO
WIPO (PCT)
Prior art keywords
dual camera
image
feature point
images
camera images
Prior art date
Application number
PCT/CN2016/075949
Other languages
English (en)
French (fr)
Inventor
唐忠伟
敖欢欢
钱康
罗巍
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP16823664.4A priority Critical patent/EP3252715B1/en
Priority to US15/572,375 priority patent/US10559090B2/en
Publication of WO2017008516A1 publication Critical patent/WO2017008516A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/14Transformations for image registration, e.g. adjusting or mapping for alignment of images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • G06T2207/10021Stereoscopic video; Stereoscopic image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose

Definitions

  • the present invention relates to video technology, and in particular, to a dual camera relative position calculation method, apparatus and device.
  • the camera generally only records two-dimensional photos, and if two cameras are used to simultaneously take a photo of an object or scene, the depth information of the original subject can be restored, thereby possibly being restored to three-dimensional information.
  • the current algorithm is difficult to distinguish the scene when it encounters a scene that is far away from the camera, or a large part of the scene is a plane or a plane, and there are no texture-rich objects in the scene. This makes it impossible to guarantee the correctness of the calculated relative position.
  • the invention provides a method, a device and a device for calculating a relative position of a dual camera, so as to realize the calculation of the relative position of the dual camera in the case that the scene is difficult to distinguish.
  • the present invention provides a dual camera relative position calculation method, including:
  • each set of dual camera images in the M group includes two images taken by the dual camera simultaneously for the same scene, respectively, and M is a positive integer;
  • the optimal dual camera relative position parameter is obtained from the Q group dual camera image relative position parameter.
  • screening each set of dual camera images to obtain a plurality of sets of dual camera images that can be used to calculate the relative positions of the dual cameras specifically includes:
  • the first set of dual camera images is determined to be a dual camera image available for relative position calculation.
  • determining the projection error between the two images in the first set of dual camera images according to the homography matrix specifically includes:
  • a projection error e between two images in the first set of dual camera images wherein H represents a homography matrix corresponding to the first set of dual camera images, and Y i represents a first image in the first set of dual camera images
  • the feature points (x i , y i ), Y′ i represent feature points (x′ i , y′ i ) of the second image in the first set of dual camera images
  • j is a positive integer, j ⁇ N′, N′
  • the number of feature point pairs (Y i , Y' i ) in the first set of dual camera images the first image is the image taken by the first camera of the two cameras, and the second image is taken by the second camera of the two cameras. image.
  • the dual camera relative position parameter corresponding to each set of dual camera images in the Q group according to each set of dual camera images in the Q group includes:
  • Each set of dual camera images is a second set of dual camera images
  • X i represents feature points (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents the second set of dual camera images a feature point (x' i , y' i ) of the second image
  • i is a positive integer, i ⁇ N
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images
  • the first image is an image taken by the first camera of the two cameras
  • the second image is an image taken by the second camera of the two cameras.
  • the relative translation distance between the two cameras is obtained according to the feature point pairs (X i , X′ i ) in the second set of dual camera images.
  • the relative rotation matrix R between the two cameras specifically includes: according to a nonlinear optimization formula Get t and R,
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • the sixth embodiment according to the nonlinear optimization formula Before getting t and R, it also includes:
  • the erroneous feature point pairs (X i , X' i ) in the second set of dual camera images are eliminated according to the random sampling consensus RANSAC algorithm.
  • the relative translation distance between the two cameras is obtained according to the feature point pairs (X i , X′ i ) in the second set of dual camera images.
  • the relative rotation matrix R between the two cameras it also includes:
  • the above process is repeated until the difference between the first distance of each feature point of the second set of dual camera images and the average of the second distance is less than the set variance threshold.
  • the obtaining the optimal dual camera relative position parameter specifically includes:
  • Each set of dual camera images in the Q group dual camera image is a second set of dual camera images, and the first distance is the distance from each feature point to the nuclear line corresponding to the feature point, and each feature point is a feature point pair.
  • (X i, X 'the feature points X i I) is, when each feature point of the feature point (X i, X' I) of the characteristic point X 'when i, X i the feature point in the second image
  • i is a positive integer, i ⁇ N
  • X i represents the feature point (x i , y i ) of the first image in the second set of dual camera images
  • X' i represents the first
  • N represents the number of feature point pairs (X i , X' i )
  • the dual camera relative position parameter of the smallest dual camera image is used as the optimal dual camera relative position parameter.
  • the average error of the first distances of all feature points in the second set of dual camera images is obtained. Specifically include:
  • X i represents a feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point of the second image in the dual camera image in the second group (x′ i , y ' i )
  • the first image is an image taken by the first camera of the two cameras
  • the second image is an image taken by the second camera of the two cameras
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the M sets of dual camera images are reacquired when the number of dual camera images available for position calculation is less than or equal to a prescribed threshold.
  • the method further includes:
  • the first distance is the distance from each feature point to the nuclear line corresponding to the feature point
  • X i represents the feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x' i , y' i ) of the second image in the second set of dual camera images
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • the present invention also provides a dual camera position calculation device, including:
  • the acquisition module is configured to acquire M sets of dual camera images, wherein each set of dual camera images in the M group comprises two images captured by the dual camera simultaneously on the same scene, wherein M is a positive integer;
  • a screening module for screening the M group of dual camera images, and obtaining a pair of dual camera images that can be used to calculate the relative positions of the dual cameras, wherein Q is a positive integer, Q ⁇ M;
  • a position calculation module configured to acquire, according to each set of dual camera images available for position calculation in the Q group, a dual camera relative position parameter corresponding to each set of dual camera images in the Q group;
  • the optimization module is configured to obtain an optimal dual camera relative position parameter from the Q group dual camera relative position parameter.
  • the screening module is specifically configured to:
  • the first set of dual camera images is determined to be a dual camera image that can be used to calculate the relative position of the dual camera.
  • the screening module is specifically configured to: Determining a projection error e between two images in each set of dual camera images, where H represents a homography matrix corresponding to each set of dual camera images, and Y i represents feature points of the first image in the first set of dual camera images (x i , y i ), Y′ i represents a feature point (x′ i , y′ i ) of the second image in the first set of dual camera images, j is a positive integer, j ⁇ N′, and N′ represents the first The number of feature point pairs (Y i , Y' i ) in the dual camera image, the first image is the image captured by the first camera of the two cameras, and the second image is the image captured by the second camera of the two cameras.
  • the calculation module is specifically configured to:
  • Each set of dual camera images is a second set of dual camera images
  • X i represents feature points (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents the second set of dual camera images
  • the feature points of the second image (x' i , y' i ), i is a positive integer, i ⁇ N
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images
  • the first image is an image taken by a first camera of the two cameras
  • the second image is an image taken by a second camera of the two cameras.
  • the location calculation module is specifically configured to:
  • K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera
  • [t] x is the antisymmetric matrix defined by t N represents the number of feature point pairs (X i , X' i ) in each set of dual camera images.
  • the location calculation module is further configured to: cull the wrong feature point pair (X i , X' i ) in the second set of dual camera images according to the RANSCA algorithm.
  • the relative translation distance between the two cameras is obtained according to the feature point pairs (X i , X′ i ) in the second set of dual camera images.
  • the above process is repeated until the difference between the first distance and the second distance of each feature point in the second set of dual camera images is less than the set variance threshold.
  • the optimization module is specifically configured to:
  • Each set of dual camera images in the Q group dual camera image is a second set of dual camera images
  • the first distance is the distance from each feature point to the nuclear line corresponding to the feature point
  • the dual camera relative position parameter of the smallest dual camera image is used as the optimal dual camera relative position parameter.
  • the optimization module is specifically configured to:
  • X i represents a feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x′ i , y′ of the second image in the second set of dual camera images i )
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the acquisition module is further configured to reacquire the M group dual camera image when the number of dual camera images available for position calculation is less than or equal to a predetermined threshold.
  • the optimization module is further configured to:
  • the first distance is the distance from each feature point to the nuclear line corresponding to the feature point
  • X i represents the feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x' i , y' i ) of the second image in the second set of dual camera images
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • the present invention provides an electronic device, including:
  • Dual camera dual camera for capturing two images simultaneously for the same scene with two cameras; one or more processors; memory; and one or more programs, one or more programs being stored in the memory and being Configured to be executed by one or more processors, the one or more programs include instructions for performing the dual camera relative position calculation method described above.
  • the present invention provides a computer readable storage medium storing one or more programs, the one or more programs including instructions for causing an electronic device to execute when executed by an electronic device including a dual camera and a plurality of applications
  • the dual camera is used to simultaneously capture two images for the same scene by two cameras.
  • the dual camera position calculation method, device, device and storage medium provided by the invention first acquire M sets of dual camera images, wherein each set of dual camera images in the M group includes two images captured by the dual camera simultaneously for the same scene.
  • the M-group dual camera images are filtered to obtain a Q-camera dual-camera image that can be used to calculate the relative position of the dual cameras, and then each set of dual-camera images in the Q group is obtained according to each set of dual camera images in the Q group.
  • the relative positional parameters of the dual cameras are finally obtained, and the optimal dual camera relative position parameters are obtained from the N sets of dual camera relative position parameters. This makes it possible to calculate the relative position of the dual camera in the case where the shooting scene is difficult to distinguish.
  • FIG. 1 is a schematic flow chart of a method for calculating a dual camera position according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic flow chart of a method for calculating a dual camera position according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic flowchart of screening a dual camera image according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic flow chart of obtaining a relative position parameter of a dual camera corresponding to a dual camera image according to Embodiment 2 of the present invention
  • FIG. 5 is a schematic flowchart of checking the relative position parameters of an optimal dual camera according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic structural diagram of a dual camera position calculating apparatus according to Embodiment 3 of the present invention.
  • FIG. 7 is a schematic structural diagram of an electronic device according to Embodiment 4 of the present invention.
  • FIG. 1 is a schematic flow chart of a method for calculating a dual camera position according to Embodiment 1 of the present invention. As shown in FIG. 1 , the dual camera position calculation method provided in this embodiment includes:
  • the two cameras included in the dual camera may generally be arranged in a left-right setting, and the two cameras are separated by a certain distance, and there may be a certain angular displacement.
  • first obtain a group M dual camera image where M is a positive integer, and the value of M can be configured in advance.
  • M is a positive integer
  • Each set of dual camera images includes images taken by the two cameras at the same time for the same scene.
  • the images captured by the two cameras are basically the same, but the angle of view of the camera is different.
  • the first image can be defined as the image captured by the first camera of the two cameras, and the second image is the second camera of the two cameras. The image taken.
  • the captured dual camera image is not suitable for obtaining the relative position of the dual camera, after acquiring the M group of dual camera images, it is also necessary to screen the M group of dual camera images to obtain the Q group available therein.
  • the M-camera dual-camera image is filtered to obtain a Q-camera dual-camera image that can be used to calculate the relative position of the dual camera, and specifically includes the following steps:
  • the set of dual camera images is determined to satisfy a dual camera image that can be used to calculate the relative position of the dual camera.
  • the first set of dual camera images is defined as each set of doubles in the M set of dual camera images Camera image.
  • the same manner as described above can be taken to determine whether the set of dual camera images can be used for the relative position calculation of the dual camera, and all pairs that can be used for relative position calculation Camera graphics are added to the Q group dual camera image.
  • determining a projection error between two images in each set of dual camera images according to the homography matrix may include: A projection error e between the two images in the first set of dual camera images is determined.
  • Feature points are present in each set of dual camera images.
  • Feature points which in turn can be referred to as salient points or key points, are used to indicate salient features in the image.
  • the feature points have extreme points of the image, the end point of the line segment, the point with the largest curvature of the curve, or the point with the largest attribute in the horizontal or vertical direction. Because each group of dual camera images has two images corresponding to the same scene, the feature points of one image in the dual camera image also have corresponding feature points in the other image.
  • Y i is the feature point coordinate (x i , y i ) of the first image in the dual camera image
  • Y′ i is the coordinate of the feature point corresponding to the second image in the dual camera image (x′ i , y ' i )
  • Y i and Y′ i which represents the spatial positional relationship of the feature points of the two images, and can be used for each group of images in the M group of dual camera images.
  • the feature point pairs (Y i , Y' i ) are represented.
  • the homography matrix H corresponding to the dual camera image describes the correspondence.
  • the homography matrix H of the set of dual camera images satisfies the following relationship:
  • the homography matrix H corresponding to the set of dual camera images can be obtained.
  • a projection error e between the two images in the set of dual camera images is determined. In the same way, the projection error e between the two images in each set of dual camera images can be obtained.
  • H represents the homography matrix corresponding to the first set of dual camera images
  • Y i represents the feature points (x i , y i ) of the first image in the first set of dual camera images
  • Y′ i represents the first set of doubles
  • j is a positive integer
  • N' represents a feature point pair (Y i , Y' i ) in the first set of dual camera images The number.
  • the set of dual camera images can be determined to be a dual camera image usable for position calculation. Specifically, after obtaining the projection error e between the two images in each set of dual camera images according to the above steps, the projection error e can be compared with a preset predetermined error threshold, when the projection error e is greater than or equal to the predetermined error.
  • the set of images may be determined to satisfy a preset condition, and may be used to calculate a dual camera image of the relative position of the dual camera, and then the set of images may be used for subsequent dual camera position calculation; when the projection error e is less than a predetermined error threshold , to determine that the group of images does not meet the preset conditions, can not be used for subsequent calculations.
  • each group of dual camera images in the M group dual camera image is filtered, and a Q camera can be used for the dual camera image of the relative position calculation of the dual camera.
  • the projection error of the other camera relative to the camera is always calculated based on the same camera, and the predetermined error is
  • the threshold value will also take different values according to different reference cameras.
  • the projection error of the second camera that is, the right camera to the left camera
  • the projection error is compared to a preset error threshold when the left camera is referenced to filter out a dual camera image that can be used to calculate the relative position of the dual camera.
  • the dual camera relative position parameter corresponding to the set of dual camera images can be obtained according to each set of dual camera images that can be used to calculate the relative position of the dual camera.
  • the dual camera relative position parameter corresponding to the dual camera characterizes the spatial positional relationship between the two cameras in the dual camera.
  • the relative translation distance t between the two cameras in the dual camera indicates the coordinate difference between the two cameras in the two cameras in the x-axis, y-axis and z-axis directions in the space rectangular coordinate system, and the relative rotation
  • the matrix R represents the angle of rotation of the two cameras relative to the x-axis, the y-axis, and the z-axis in the spatial Cartesian coordinate system, respectively, in the spatial Cartesian coordinate system.
  • the Q group is represented by X i Feature points (x i , y i ) of the first image in each set of dual camera images, and X′ i represents feature points (x′ i , y′ i ) of the second image in each set of dual camera images in the Q group .
  • the pair of feature points (X i , X' i ) in the dual camera image represents a specific correspondence between X i and X′ i .
  • the relative translation distance t between the two cameras and the relative rotation matrix R between the two cameras can be obtained by using the pair of feature points (X i , X' i ).
  • X i , X′ i and Y i and Y′ i are only provided to distinguish whether the image where the feature point is located in the M group dual camera image or the Q group dual camera image, and X i , X 'physical meaning previously set M i represents each feature point in the dual camera image and Y i Y' i no practical difference.
  • the step of obtaining a relative translation distance t between the two cameras and a relative rotation matrix R between the two cameras according to the feature point pairs (X i , X′ i ) in the second set of dual camera images may include :
  • K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera
  • [t] x is the antisymmetric matrix defined by t i is a positive integer, i ⁇ N, and N represents the number of feature point pairs (X i , X' i ) in each set of dual camera images.
  • l i l ia vector first component and a second component is a l i l ib decomposition vectors obtained, for example, l ia and l ib, respectively, may be the l i vectors orthogonal decomposition, in two mutually component in the direction orthogonal to the generated,
  • a first component of the vector L i 'l ia and the second component l' may be the IB l 'i after orthogonal vector orthogonal decomposition, resulting Two components in the direction.
  • the feature point pairs (X i , X' i ) in the erroneous dual camera image may be eliminated according to the random sampling consensus algorithm, specifically using the known random sampling consistency (Random Sample)
  • the Consensus (RANSAC) algorithm finds the wrong feature point pairs (X i , X' i ). In subsequent calculations, these erroneous feature point pairs are not applicable.
  • RANSAC Random Sample
  • Point pairs (X i , X' i ) test the prediction results, assuming that all feature point pairs include intra- and out-of-point points, where the intra-point points approximate the line corresponding to the estimated result, and the out-of-point points Keep away from the straight line of the estimated results. At this point, iteratively, iteratively, to obtain better prediction results, and feature points that do not meet the estimated results are discarded.
  • the verification process may include the following steps:
  • the feature point When the difference between the first distance and the second distance of the feature point to the corresponding nuclear line is greater than the set variance threshold, it indicates that the difference between the feature point and the remaining feature points is large, and the feature point should be discarded and utilized.
  • the remaining feature points reacquire the relative translation distance t and the relative rotation matrix R between the two cameras.
  • Obtaining the optimal dual camera relative position parameters specifically includes:
  • Each set of dual camera images in the Q group dual camera image is a second set of dual camera images.
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the optimal dual camera position parameter indicates the relative positional relationship between one camera and the other camera in the dual camera.
  • the method further includes:
  • the first distance is a distance from each feature point to the feature point corresponding epipolar line
  • each feature point is a feature point in the feature point pair (X i , X' i )
  • the reference image is the M taken by the dual camera. Grouping images other than the dual camera image;
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • the M sets of dual camera images are first acquired, wherein each set of dual camera images in the M group includes two images captured by the dual camera simultaneously on the same scene, and then the M sets of dual camera images are filtered to obtain
  • the Q group can be used to calculate the dual camera image of the relative position of the dual camera, wherein M and Q are both positive integers and Q ⁇ M; then, according to each set of dual camera images in the Q group, each set of dual camera images in the Q group is obtained.
  • the dual camera position calculation method includes:
  • the number of sets of acquired dual camera images can be set using a predetermined program.
  • the M camera it is possible to set the M camera to capture M groups of images, and the value of M can be set in the configuration file. After acquiring the M sets of images, the M sets of images are subjected to screening calculations in subsequent steps.
  • the captured dual camera image is not suitable for calculating the relative position of the dual camera, after acquiring multiple sets of dual camera images, it is also necessary to filter each set of dual cameras to obtain multiple sets to meet the preset conditions. This can be used to calculate a dual camera image of the relative position of the dual camera for subsequent dual camera position calculation. For example, the following situations are not suitable for subsequent dual camera position calculations:
  • the main part of the scene or scene is the plane or close to the plane;
  • the scenes or objects captured by the two cameras in the dual camera are relatively similar, and the contrast is low, that is, the objects captured by the two cameras are difficult to distinguish or distinguish, so it is necessary to use projection errors or the like.
  • the parameters that characterize the similarity of the two images are filtered out, and the images that cannot be calculated by the position are filtered out, thereby filtering the above-mentioned scenes or objects that cannot be used for calculation.
  • FIG. 3 is a schematic flow chart of screening each set of dual camera images according to Embodiment 2 of the present invention. As shown in FIG. 3, the step may further include:
  • h (H 11 , H 12 , H 13 , H 21 , H 22 , H 23 , H 31 , H 32 , H 33 ) T ,
  • b x (-x 1 , -y 1 -1,0,0,0,x' 1 x 1 ,x' 1 y 1 ,x' 2 ) T ,
  • N' represents the number of feature point pairs (Y i , Y' i ) in the first set of dual camera images.
  • h After obtaining the feature point pairs, h can be solved according to the least square method or the gradient descent method, and then the correlation matrix H is obtained.
  • the projection error e can be compared with a preset predetermined error threshold, when the projection error e is greater than or equal to
  • the first set of images may be determined to be a dual camera image usable for calculating the relative position of the dual camera, and then the first set of images may be used for subsequent dual camera position calculation; when the projection error e is less than a predetermined error threshold When it is determined that the first group of images does not satisfy the preset condition, it cannot be used for subsequent dual camera relative position calculation.
  • the number of dual camera images that can be used to calculate the relative position of the dual camera is less than or equal to a predetermined threshold, in order to prevent problems in subsequent calculations due to too few samples, it is necessary to reacquire the M sets of dual camera images to re-execute Calculation.
  • a predetermined threshold For example, if the number of groups of images available for position calculation is Q and the specified threshold is L, when Q ⁇ L, it means that there are too few reasonable images in the obtained Q group images, and it is necessary to recapture the M group images. .
  • the dual camera relative position parameters corresponding to the dual camera images can be obtained according to each set of dual camera images that can be used for position calculation.
  • 4 is a schematic flow chart of obtaining relative position parameters corresponding to a dual camera image according to Embodiment 2 of the present invention. As shown in FIG. 4, the dual camera relative position parameter corresponding to the dual camera image is obtained according to each set of dual camera images in the Q group, and specifically includes:
  • the feature point pairs (X i , X' i ) in the dual camera image satisfy the following relationship:
  • K is the internal reference matrix of the first camera
  • K' is the internal reference matrix of the second camera
  • [t] x is the antisymmetric matrix defined by t
  • the relative translation distance t between the two cameras and the relative rotation matrix R between the two cameras can be solved by the internal reference matrix K, K' of the two cameras and the pair of feature points (X i , X' i ). .
  • the step may include:
  • This step is an optional step.
  • the specific process is to find out the wrong feature point pair (X i , X' i ) by using a known random sampling consensus algorithm and delete it to ensure subsequent calculation.
  • K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera
  • [t] x is the antisymmetric matrix defined by t N represents the number of feature point pairs (X i , X' i ) in each set of dual camera images.
  • l i l ia vector first component and a second component may be a component l ib, respectively, in different directions after decomposition l i vectors, for example after orthogonal decomposition, facing each other in two component in the direction orthogonal to the generated
  • a first component of the vector L i 'l ia and the second component l' may be the IB l 'i vectors after the orthogonal direction orthogonal decomposition, resulting The two components on it.
  • the difference between the first distance and the second distance of the feature point is greater than the set variance threshold, for example, three times the variance of the average value, it indicates that the difference between the feature point and the remaining feature points is large, and the feature point should be discarded at this time. And re-acquiring the relative translation distance t and the relative rotation matrix R between the two cameras by using the remaining feature points whose difference between the first distance and the second distance is less than or equal to the set variance threshold.
  • the steps S401 to S404 are repeated, and the calculation result is verified until the difference between the first distance and the second distance of each feature point of the second set of dual camera images to the corresponding nuclear line of the feature point is smaller than the set The variance threshold is determined. At this time, the distance from each feature point of the dual camera image to the corresponding nuclear line of the feature point is close to the same.
  • Obtaining the optimal relative position parameters specifically includes:
  • X i represents the feature points (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents the feature points of the second image in the second set of dual camera images (x′ i , y′ i )
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • FIG. 5 is a schematic flow chart of checking the relative position parameters of an optimal dual camera according to Embodiment 2 of the present invention. As shown in FIG. 5, the verification of the optimal relative position parameters of the dual camera may include the following steps:
  • the dual camera position calculation method is re-executed.
  • a set of dual camera images can be reacquired, and the set of dual camera images does not belong to one of the M groups of dual camera images, and the reacquisition is obtained according to the optimal relative position parameter.
  • Independent mean error of the first distance of the feature points in the independent dual camera image in case If it is greater than the predetermined error threshold, it indicates that the optimal relative position parameter is not applicable to other images, and the dual camera position calculation method needs to be re-executed to obtain a new optimal dual camera relative position parameter.
  • the final optimal dual camera relative position parameter can be obtained.
  • the dual camera position calculation method specifically includes: first acquiring M sets of dual camera images, wherein each set of dual camera images in the M group includes two images captured by the dual camera simultaneously for the same scene, and then the M group dual camera images. Perform a screening to obtain a Q camera image that can be used to calculate the relative position of the dual camera, where Q ⁇ M, and then according to the Q group Each set of dual camera images acquires the dual camera relative position parameters corresponding to the dual camera images, and finally obtains the optimal dual camera relative position parameters in the dual camera relative position parameters corresponding to all the dual camera images.
  • the calculation of the relative position of the dual camera can be realized in the case where the shooting scene is difficult to distinguish.
  • FIG. 6 is a schematic structural diagram of a dual camera relative position calculating apparatus according to Embodiment 3 of the present invention.
  • the dual camera relative position calculating apparatus provided in this embodiment can perform the method flow described in the foregoing Embodiments 1 and 2.
  • the dual camera position calculating device 61 provided in this embodiment includes:
  • the acquisition module 601 is configured to acquire M sets of dual camera images, wherein each set of dual camera images in the M group includes two images captured by the dual camera simultaneously for the same scene, and M is a positive integer;
  • the screening module 602 is configured to filter the M group of dual camera images to obtain a Q camera group image for position calculation of the relative position of the dual camera, wherein Q is a positive integer, Q ⁇ M;
  • a location calculation module 603 configured to acquire, according to each set of dual camera images in the Q group, a dual camera relative position parameter corresponding to each set of dual camera images in the Q group;
  • the optimization module 604 is configured to obtain an optimal dual camera relative position parameter from the Q group dual camera relative position parameter.
  • the screening module 602 can be specifically configured to:
  • the first set of dual camera images is determined to be a dual camera image that can be used to calculate the relative position of the dual camera.
  • the screening module 602 can be used to: Determining a projection error e between two images in the first set of dual camera images, wherein H represents a homography matrix corresponding to the first set of dual camera images, and Y i represents a first image in the first set of dual camera images
  • the feature points (x i , y i ), Y′ i represent feature points (x′ i , y′ i ) of the second image in the first set of dual camera images, and the first image is taken by the first camera in the two cameras Image, the second image is the image taken by the second camera of the two cameras, j is a positive integer, j ⁇ N', N' represents the feature point pair (Y i , Y' i ) in the first set of dual camera images Number.
  • the location calculation module 603 can be specifically configured to:
  • Each set of dual camera images is a second set of dual camera images
  • X i represents feature points (x i , y i ) in the first image of the second set of dual camera images
  • X′ i represents the second set of dual camera images.
  • the feature points (x' i , y' i ) of the second image, i is a positive integer, i ⁇ N, and N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the location calculation module 603 can be specifically configured to:
  • l ia , l ib are the first component and the second component of the l i vector, respectively
  • l' ia , l' ib are the first component and the second component of the l' i vector, respectively
  • K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera
  • [t] x is the antisymmetric matrix defined by t N represents the number of feature point pairs (X i , X' i ) in the dual camera image.
  • the location calculation module 603 is further configured to: cull the wrong feature point pair (X i , X' i ) in the second set of dual camera images according to the RANSCA algorithm.
  • the position calculation module 603 After obtaining the relative translation distance t between the two cameras and the relative rotation matrix R between the two cameras according to the feature point pairs (X i , X' i ) in the second set of dual camera images, the position calculation module 603 further Used for:
  • the above process is repeated until the difference between the first distance of each feature point of the second set of dual camera images and the average of the second distance is less than the set variance threshold.
  • optimization module 604 is specifically configured to:
  • the first distance is the distance from each feature point to the nuclear line corresponding to the feature point, and each set of dual camera images in the Q group dual camera image is a second set of dual camera images, and the first distance is for each feature point.
  • the dual camera relative position parameter of the smallest dual camera image is used as the optimal dual camera relative position parameter.
  • optimization module 604 is configured to Obtaining the average error of the first distance of the feature points in the second set of dual camera images among them
  • X i represents a feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x′ i , y′ i ) of the second image in the second set of dual camera images
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the collecting module 601 is further configured to reacquire the M sets of dual camera images when the number of dual camera images available for position calculation is less than or equal to a predetermined threshold.
  • the optimization module 604 is further configured to:
  • the reference image is an image of the acquired M group of dual camera images taken by the dual camera;
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • the acquisition module in the dual camera relative position calculation device is configured to acquire multiple M sets of dual camera images, wherein each set of dual camera images in the M group includes two images captured by the dual camera simultaneously for the same scene;
  • the screening module is configured to filter the M group of dual camera images to obtain a Q camera that can be used to calculate the dual camera image relative position of the dual camera;
  • the position calculation module is configured to acquire Q according to each set of dual camera images available for position calculation in the Q group.
  • the optimization module is configured to obtain an optimal dual camera relative position parameter in all dual camera relative position parameters. In this way, the dual camera relative position calculating device can realize the calculation of the relative position of the dual camera in the case that the shooting scene is difficult to distinguish.
  • FIG. 7 is a schematic structural diagram of an electronic device according to Embodiment 4 of the present invention.
  • the electronic device provided in this embodiment may perform the method flow described in the foregoing Embodiments 1 and 2.
  • the electronic device 71 provided in this embodiment includes:
  • a dual camera 701 for capturing two images simultaneously for the same scene by two cameras
  • the instructions of the dual camera relative position calculation method include:
  • each set of dual camera images in the M group includes two images taken by the dual camera simultaneously for the same scene, wherein M is a positive integer;
  • Screening the M camera's dual camera image, and obtaining the Q camera can be used to calculate the dual camera image of the relative position of the dual camera, where Q is a positive integer and Q ⁇ M;
  • the optimal dual camera relative position parameter is obtained from the Q group dual camera relative position parameter.
  • screening each set of dual camera images to obtain multiple sets of dual camera images that can be used for relative position calculation specifically includes:
  • the first set of dual camera images is determined to be a dual camera image that can be used to calculate the relative position of the dual camera.
  • determining the projection error between the two images in each set of dual camera images according to the homography matrix specifically includes:
  • a projection error e between two images in the first set of dual camera images wherein H represents a homography matrix corresponding to the first set of dual camera images, and Y i represents a first image in the first set of dual camera images
  • the feature points (x i , y i ), Y′ i represent the feature points (x′ i , y′ i ) of the second image in the first set of dual camera images
  • j is a positive integer
  • N′ Indicates the number of feature point pairs (Y i , Y' i ) in the first set of dual camera images
  • the first image is the image captured by the first camera of the two cameras
  • the second image is the second camera of the two cameras.
  • the dual camera relative position parameters corresponding to each set of dual camera images in the Q group according to each set of dual camera images in the Q group specifically include:
  • Each set of dual camera images is a second set of dual camera images
  • X i represents the feature points (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents the second set of dual camera images.
  • a feature point of the two images (x' i , y' i ), where i is a positive integer, i ⁇ N, and N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images,
  • the first image is an image taken by a first camera of the two cameras
  • the second image is an image taken by a second camera of the two cameras.
  • obtaining a relative translation distance t between the two cameras and a relative rotation matrix R between the two cameras according to the feature point pairs (X i , X′ i ) in each set of dual camera images in the Q group specifically includes: Nonlinear optimization formula Get t and R,
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • the erroneous feature point pairs (X i , X' i ) in the second set of dual camera images are eliminated according to the random sampling consensus RANSAC algorithm.
  • the method further includes :
  • the above process is repeated until the difference between the first distance of each feature point of the second set of dual camera images and the average of the second distance is less than the set variance threshold.
  • obtaining the optimal dual camera relative position parameter specifically includes:
  • Each set of dual camera images in the Q group dual camera image is a second set of dual camera images, and the first distance is the distance from each feature point to the nuclear line corresponding to the feature point, and each feature point is a feature point pair.
  • obtaining an average error of the first distance of all feature points in each dual camera image Specifically include:
  • X i represents a feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x′ i , y′ i ) of the second image in the second set of dual camera images
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the M sets of dual camera images should be reacquired.
  • the method further includes:
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • the electronic device 71 includes: a dual camera 701 for simultaneously capturing two images for the same scene by two cameras; one or more processors 702; a memory 703; and one or more programs One or more programs are stored in the memory 703 and configured to Executed by one or more processors 702, the one or more programs include instructions for performing the dual camera relative position calculation method according to the previous embodiments. In this way, the electronic device can realize the calculation of the relative position of the dual camera in the case that the shooting scene is difficult to distinguish.
  • the present invention also provides a computer readable storage medium storing one or more programs, the one or more programs comprising instructions that, when executed by an electronic device comprising a dual camera and a plurality of applications The electronic device performs the dual camera relative position calculation method according to the previous embodiment, wherein the dual camera is used to capture the same scene with two cameras.
  • the dual camera relative position calculation method performed by the electronic device includes:
  • each set of dual camera images in the M group includes two images taken by the dual camera simultaneously for the same scene, wherein M is a positive integer;
  • Screening the M camera's dual camera image, and obtaining the Q camera can be used to calculate the dual camera image of the relative position of the dual camera, where Q is a positive integer and Q ⁇ M;
  • the optimal dual camera relative position parameter is obtained from the Q group dual camera relative position parameter.
  • screening each set of dual camera images to obtain multiple sets of dual camera images that can be used for relative position calculation specifically includes:
  • the first set of dual camera images is determined to be a dual camera image that can be used to calculate the relative position of the dual camera.
  • determining the projection error between the two images in each set of dual camera images according to the homography matrix specifically includes:
  • a projection error e between two images in the first set of dual camera images wherein H represents a homography matrix corresponding to the first set of dual camera images, and Y i represents a first image in the first set of dual camera images
  • the feature points (x i , y i ), Y′ i represent feature points (x′ i , y′ ii ) of the second image in the first set of dual camera images
  • j is a positive integer
  • N′ Indicates the number of feature point pairs (Y i , Y' i ) in the first set of dual camera images
  • the first image is the image captured by the first camera of the two cameras
  • the second image is the second camera of the two cameras.
  • the dual camera relative position parameters corresponding to each set of dual camera images in the Q group according to each set of dual camera images in the Q group specifically include:
  • Each set of dual camera images is a second set of dual camera images
  • X i represents the feature points (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents the second set of dual camera images.
  • a feature point of the two images (x' i , y' i ), where i is a positive integer, i ⁇ N, and N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images,
  • the first image is an image taken by a first camera of the two cameras
  • the second image is an image taken by a second camera of the two cameras.
  • obtaining a relative translation distance t between the two cameras and a relative rotation matrix R between the two cameras according to the feature point pairs (X i , X′ i ) in each set of dual camera images in the Q group specifically includes: Nonlinear optimization formula Get t and R,
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • the erroneous feature point pairs (X i , X' i ) in the second set of dual camera images are eliminated according to the random sampling consensus RANSAC algorithm.
  • the method further includes :
  • the above process is repeated until the difference between the first distance of each feature point of the second set of dual camera images and the average of the second distance is less than the set variance threshold.
  • obtaining the optimal dual camera relative position parameter specifically includes:
  • Each set of dual camera images in the Q group dual camera image is a second set of dual camera images, and the first distance is the distance from each feature point to the nuclear line corresponding to the feature point, and each feature point is a feature point pair.
  • obtaining an average error of the first distance of all feature points in each dual camera image Specifically include:
  • X i represents a feature point (x i , y i ) of the first image in the second set of dual camera images
  • X′ i represents a feature point (x′ i , y′ i ) of the second image in the second set of dual camera images
  • l ia , l ib are the first component and the second component of the l i vector, respectively, l' ia , l' ib are the first component and the second component of the l' i vector, respectively, and K is the internal reference matrix of the first camera.
  • K' is the internal parameter matrix of the second camera, and [t] x is the antisymmetric matrix defined by t
  • N represents the number of feature point pairs (X i , X' i ) in the second set of dual camera images.
  • the M sets of dual camera images should be reacquired.
  • the method further includes:
  • the double camera position calculation method is re-executed by greater than or equal to the predetermined error threshold.
  • a computer readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by an electronic device including a dual camera and a plurality of applications, cause the electronic device to perform according to the front
  • the dual camera position calculating device can realize the calculation of the relative position of the dual camera in the case where the shooting scene is difficult to distinguish.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

一种双摄像头相对位置计算方法、装置和设备。所述方法包括:获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像(S101);对所述M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像(S102);根据Q组中的每组双摄像头图像获取所述Q组中的每组双摄像头图像所对应的双摄像头相对位置参数(S103);从所述Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数(S104)。该方法可以在场景较难分辨的情况下,实现双摄像头相对位置的计算。

Description

双摄像头相对位置计算方法、装置和设备
本申请要求于2015年07月15日提交中国专利局,申请号为201510416283.2、发明名称为“双摄像头相对位置计算方法、装置和设备”的中国专利申请,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及视频技术,尤其涉及一种双摄像头相对位置计算方法、装置和设备。
背景技术
摄像头一般只能记录下二维的照片,而如果利用两个摄像头同时对一个物体或者场景拍摄照片,则可以恢复原始被拍摄物的深度信息,从而可能还原成为三维信息。
目前,在利用两个摄像头进行拍摄,计算原始被拍摄物的深度信息时,我们需要用于表示两个摄像头之间相对位置的准确信息。但是在用户使用过程中,两个摄像头之间的相对位置却可能会因为落摔、压力、温度等的影响而发生变化,从而和原始的相对位置不符。因而需要对双摄像头中两个摄像头之间的相对位置重新进行计算。当前,可以利用一组图像来计算双摄像头之间的相对位置。通过假设摄像头的内部参数固定不变,利用算法推算出双摄像头中两个摄像头之间的相对位置。
然而,目前的算法当遇到拍摄的场景离摄像头很远,或者场景里有很大一部分是一个平面或者接近一个平面,以及场景中没有纹理丰富的物体等情况时,因对场景的分辨较为困难,导致无法保证计算出的相对位置的正确性。
发明内容
本发明提供一种双摄像头相对位置计算方法、装置和设备,以在场景较难分辨的情况下,实现双摄像头相对位置的计算。
第一方面,本发明提供一种双摄像头相对位置计算方法,包括:
获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,M为正整数;
对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像,Q为正整数,且Q≤M;
根据Q组中的每组双摄像头图像获取N组中的每组双摄像头图像所对应的双摄像头相对位置参数;
从Q组双摄像头图像相对位置参数中获取最优双摄像头相对位置参数。
结合第一方面,在第一种实施方式中,相对位置参数包括两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
结合第一方面和第一种实施方式,在第二种实施方式中,对每组双摄像头图像进行筛选,以获得多组可用于计算双摄像头相对位置的双摄像头图像具体包括:
获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于相对位置计算的双摄像头图像。
结合第一方面和前两种实施方式,在第三种实施方式中,根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差具体包括:
根据
Figure PCTCN2016075949-appb-000001
确定第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示第一组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄像头图像中第一图像的特征点(xi,yi),Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y'i),j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
结合第一方面和前三种实施方式,在第四种实施方式中,根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数具体包括:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),其中,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
结合第一方面和前四种实施方式,在第五种实施方式中,根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R具体包括:根据非线性优化公式
Figure PCTCN2016075949-appb-000002
获取t和R,
其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000003
结合第一方面和前五种实施方式,在第六种实施方式中,根据非线性优化公式
Figure PCTCN2016075949-appb-000004
获取t和R之前,还包括:
根据随机抽样一致RANSAC算法剔除第二组双摄像头图像中错误的特征点对(Xi,X'i)。
结合第一方面和前六种实施方式,在第七种实施方式中,根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R之后,还包括:
根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中第一距离为每一个特征点到与该特征点对应的核线的距离;
当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xK-1Xi
当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000005
根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值;
根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R;
重复上述过程,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离的平均值的差均小于设定方差阈值。
结合第一方面和前七种实施方式,在第八种实施方式中,获取最优双摄像头相对位置参数具体包括:
获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000006
其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),N表示第二组双摄像头图像中的特征点对(Xi,X'i)的个数,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000007
第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像;
将平均误差
Figure PCTCN2016075949-appb-000008
最小的双摄像头图像的双摄像头相对位置参数作为最优双摄像头相对位置参数。
结合第一方面和前八种实施方式,在第九种实施方式中,获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000009
具体包括:
根据
Figure PCTCN2016075949-appb-000010
获得第二组双摄像头图像中特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000011
其中
Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组中双摄像头图像中的第二图像的特征点(x'i,y'i),第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000012
N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
结合第一方面和前九种实施方式,在第十种实施方式中,当可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,重新获取M组双摄像头图像。
结合第一方面和前十种实施方式,在第十一种实施方式中,在获取最优双摄像头相对位置参数之后,还包括:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000013
其中第一距离为每一个特征点到与该特征点对应的核线的距离,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000014
第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像,参考图像为双摄像头所拍摄的在获取的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000015
大于或等于预定误差阈值,重新执行双摄像头位置计算方法。
第二方面,本发明还提供一种双摄像头位置计算装置,包括:
采集模块,用于获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,其中M为正整数;
筛选模块,用于对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像,其中Q为正整数,Q≤M;
位置计算模块,用于根据Q组中的每组可用于位置计算的双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数;
优化模块,用于从Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
结合第二方面,在第一种实施方式中,相对位置参数包括两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
结合第二方面和第一种实施方式,在第二种实施方式中,筛选模块具体用于:
获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于计算双摄像头相对位置的双摄像头图像。
结合第二方面和前两种实施方式,在第三种实施方式中,筛选模块具体用 于:根据
Figure PCTCN2016075949-appb-000016
确定每组双摄像头图像中两幅图像之间的投影误差e,其中,H表示每组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄像头图像中第一图像的特征点(xi,yi),Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y'i),j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
结合第二方面和前三种实施方式,在第四种实施方式中,计算模块具体用于:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
结合第二方面和前四种实施方式,在第五种实施方式中,位置计算模块具体用于:
根据非线性优化公式
Figure PCTCN2016075949-appb-000017
获得t和R,其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000018
N表示每组双摄像头图像中特征点对(Xi,X'i)的个数。
结合第二方面和前五种实施方式,在第六种实施方式中,根据非线性优化公式
Figure PCTCN2016075949-appb-000019
获取t和R之前,位置计算模块还用于:根据RANSCA算法剔除第二组双摄像头图像中错误的特征点对(Xi,X'i)。
结合第二方面和前六种实施方式,在第七种实施方式中,根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像 头之间的相对旋转矩阵R之后,位置计算模块还用于:根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xK-1Xi,当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000020
根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值;
根据第一距离与第二距离的平均值的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R;
重复上述过程,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离的差均小于设定方差阈值。
结合第二方面和前七种实施方式,在第八种实施方式中,优化模块具体用于:
获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000021
Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000022
第一图像为两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像;
将平均误差
Figure PCTCN2016075949-appb-000023
最小的双摄像头图像的双摄像头相对位置参数作为最优双摄像头相对位置参数。
结合第二方面和前八种实施方式,在第九种实施方式中,优化模块具体用于:
根据
Figure PCTCN2016075949-appb-000024
获得第二组双摄像头图像中特征点的第一距离 的平均误差
Figure PCTCN2016075949-appb-000025
其中
Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000026
i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
结合第二方面和前九种实施方式,在第十种实施方式中,采集模块还用于:当可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,重新获取M组双摄像头图像。
结合第二方面和前十种实施方式,在第十一种实施方式中,在获取最优相对位置参数之后,优化模块还用于:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000027
其中第一距离为每一个特征点到与该特征点对应的核线的距离,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000028
第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像,参考图像为双摄像头所拍摄的在获取的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000029
大于或等于所述预定误差阈值,重新执行双摄像头位置计算方法。
第三方面,本发明提供一种电子设备,包括:
双摄像头,双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像;一个或多个处理器;存储器;以及一个或多个程序,其中一个或多个程序被存储在存储器中并被配置为被一个或多个处理器执行,一个或多个程序包括用于执行根据上述的双摄像头相对位置计算方法的指令。
第四方面,本发明提供一种存储一个或多个程序的计算机可读存储介质,一个或多个程序包括指令,指令当被包括双摄像头和多个应用程序的电子设备执行时使电子设备执行根据上述的双摄像头相对位置计算方法,其中,双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像。
本发明提供的双摄像头位置计算方法、装置、设备和存储介质,先获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,再对该M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像,然后根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数,最后从N组双摄像头相对位置参数中获取最优双摄像头相对位置参数。这样可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例一提供的双摄像头位置计算方法的流程示意图;
图2是本发明实施例二提供的双摄像头位置计算方法的流程示意图;
图3是本发明实施例二提供的对双摄像头图像进行筛选的流程示意图;
图4是本发明实施例二提供的获得双摄像头图像所对应的双摄像头相对位置参数的流程示意图;
图5是本发明实施例二提供的对最优双摄像头相对位置参数进行验算的流程示意图;
图6是本发明实施例三提供的双摄像头位置计算装置的结构示意图;
图7是本发明实施例四提供的电子装置的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其 他实施例,都属于本发明保护的范围。
图1是本发明实施例一提供的双摄像头位置计算方法的流程示意图。如图1所示,本实施例提供的双摄像头位置计算方法包括:
S101、获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像。
具体的,双摄像头在拍摄图像时,双摄像头所包含的两个摄像头之间一般可以为左右设置等设置方式,两个摄像头之间间隔一定距离,并可能存在一定的角度位移。利用双摄像头进行拍摄时,首先获取M组双摄像头图像,其中,M为正整数,M的取值可以预先进行配置。每一组双摄像头图像都包括由这两个摄像头在同一时间对同一场景各自所拍摄的图像。这两个摄像头各自拍摄的图像基本一致,只是摄像头的视角有所差异,可以定义第一图像为两个摄像头中第一摄像头所拍摄的图像,而第二图像为两个摄像头中第二摄像头所拍摄的图像。
S102、对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像。
因为拍摄到的双摄像头图像并不一定适合用来获取双摄像头的相对位置,所以获取了M组双摄像头图像之后,还需要针对这M组双摄像头图象进行筛选,以在其中获取Q组可用于计算双摄像头相对位置的双摄像头图像,以进行后续的双摄像头位置计算过程,其中Q也为正整数,且Q≤M。
进一步的,当可用于位置计算的双摄像头图像的数量少于规定阈值时,还需要重新获取多组双摄像头图像,以重新进行计算。
具体的,对M组双摄像头图像进行筛选,以获得Q组可用于计算双摄像头相对位置的双摄像头图像,具体可以包括以下步骤:
对于M组双摄像头图像中的每一组图像:
1)获取第一组双摄像头图像所对应的单应性矩阵,其中M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
2)根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定该组双摄像头图像为满足可用于计算双摄像头相对位置的双摄像头图像。
其中,第一组双摄像头图像被定义为在这M组双摄像头图像中的每一组双 摄像头图像。对于M组双摄像头图像中的每一组双摄像头图像,都可以采取上述同样的方式,以确定该组双摄像头图像是否可用于双摄像头的相对位置计算,并将可用于相对位置计算的所有双摄像头图形都加入Q组双摄像头图像中。
需要说明的是,当本发明实施例提及“第一”、“第二”等序数词时,除非根据上下文其确实表达顺序之意,应当理解为仅仅是起区分之用。
具体的,根据单应性矩阵确定每组双摄像头图像中两幅图像之间的投影误差可以包括:根据
Figure PCTCN2016075949-appb-000030
确定第一组双摄像头图像中两幅图像之间的投影误差e。
每组双摄像头图像中,都会存在特征点。特征点又可称为显著点或者关键点,用以表明图像中的显著特征。特征点有图像的极值点,线段的终点,曲线曲率最大的点或者水平或者竖直方向上属性最大的点等。因为每组双摄像头图像中有对应同一场景的两幅图像,所以双摄像头图像中一幅图像的特征点在另一幅图像中也存在有对应的特征点。如果以Yi表示双摄像头图像中第一图像的特征点坐标(xi,yi),而以Y'i表示双摄像头图像中第二图像对应的该特征点的坐标(x'i,y'i),则Yi和Y'i之间存在有一特定的对应关系,该对应关系表征了这两幅图像的特征点的空间位置关系,且可用M组双摄像头图像中每一组图像的特征点对(Yi,Y'i)进行表示。双摄像头图像所对应的单应性矩阵H描述了该对应关系。
具体的,对于一组双摄像头图像,该组双摄像头图像的单应性矩阵H满足如下关系:
Figure PCTCN2016075949-appb-000031
对上述方程进行求解,即可得到该组双摄像头图像所对应的单应性矩阵H。
求解出该组双摄像头图像所对应的单应性矩阵H后,再根据
Figure PCTCN2016075949-appb-000032
确定该组双摄像头图像中两幅图像之间的投影误差e。采用同样的方式,可以得到每组双摄像头图像中两幅图像之间的投影误差e。
其中,H表示第一组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄像头图像中第一图像的特征点(xi,yi),Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y'i),j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数。
当投影误差e大于或等于预定误差阈值时,即可确定该组双摄像头图像为可用于位置计算的双摄像头图像。具体的,根据上述步骤获得各组双摄像头图像中两幅图像间的投影误差e后,即可将该投影误差e与预先设定的预定误差阈值进行比较,当投影误差e大于或等于预定误差阈值时,可确定该组图像为满足预设条件,可用于计算双摄像头相对位置的双摄像头图像,然后可用该组图像进行后续的双摄像头位置计算;当投影误差e小于预定误差阈值时,确定该组图像不满足预设条件,不能用于后续计算。对M组双摄像头图像中的每组双摄像头图像采用同样的方式筛选,可以得到Q组可用于双摄像头相对位置计算的双摄像头图像。
需要说明的是,在上述根据单应性矩阵计算两幅图像之间的投影误差e时,应保证始终以同一个摄像头为基准,计算另一个摄像头相对于该摄像头的投影误差,同时,预定误差阈值也会根据不同的基准摄像头而取不同值,例如可以始终以第一摄像头,如左侧摄像头为基准,计算第二摄像头,也就是右侧摄像头到左摄像头的投影误差,并将计算得到的投影误差与左侧摄像头为基准时的预设误差阈值进行比较,以筛选出可用于计算双摄像头相对位置的双摄像头图像。
S103、根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数。
获取了可用于双摄像头相对位置计算的Q组双摄像头图像后,即可根据每一组可用于计算双摄像头相对位置的双摄像头图像获得与该组双摄像头图像所对应的双摄像头相对位置参数。双摄像头所对应的双摄像头相对位置参数表征了双摄像头中两个摄像头之间的空间位置关系。具体的,双摄像头所对应的双摄像头相对位置参数包括双摄像头中两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中t=(tx,ty,tz)T,x、y和z分别为平面直角 坐标系的三个正交坐标轴。双摄像头中两个摄像头之间的相对平移距离t表示了双摄像头中两个摄像头在空间直角坐标系中x轴、y轴和z轴三个不同坐标轴方向上的坐标差值,而相对旋转矩阵R则表示这两个摄像头在空间直角坐标系中分别相对于空间直角坐标系中x轴、y轴和z轴的旋转角度。根据每组可用于位置计算的双摄像头图像获得双摄像头图像所对应的双摄像头相对位置参数,具体包括:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像。
为了与前面的M组双摄像头图像中的每组双摄像头图像进行区分,在这Q组中的每组双摄像头图像的特征点对(Xi,X'i)中,利用Xi表示Q组中每组双摄像头图像中第一图像的特征点(xi,yi),而X'i表示Q组中每组双摄像头图像中第二图像的特征点(x'i,y'i)。双摄像头图像中的特征点对(Xi,X'i)表示了Xi和X'i之间存在的特定的对应关系。利用特征点对(Xi,X'i)即可求出两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R。
需要说明的是,上述Xi、X'i与Yi和Y'i仅为区分该特征点所在的图像是位于M组双摄像头图像中还是Q组双摄像头图像中而设,而Xi、X'i所代表的物理意义与前面M组中每组双摄像头图像的特征点Yi和Y'i并无实际区别。
具体的,根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R这一步骤可以包括:
根据非线性公式获取t和R。
具体的,非线性公式为
Figure PCTCN2016075949-appb-000033
其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x 为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000034
i为正整数,i≤N,N表示每组双摄像头图像中特征点对(Xi,X'i)的个数。
此处,li向量的第一分量lia和第二分量lib是li向量进行分解所得到的,例如lia和lib分别可以是li向量进行正交分解后,在两个相互正交的方向上所产生的分量,同理,l'i向量的第一分量l'ia和第二分量l'ib也可以是将l'i向量进行正交分解后,所产生的正交方向上的两个分量。
可选的,在获取t和R之前,还可以根据随机抽样一致算法剔除错误的双摄像头图像中的特征点对(Xi,X'i),具体为利用已知的随机抽样一致(Random Sample Consensus,简称RANSAC)算法查找出错误的特征点对(Xi,X'i),在后续计算中,不适用这些错误的特征点对。在利用RANSAC算法时,首先从部分特征点对(Xi,X'i)中得到预估的结果,例如是和正确的匹配点吻合的基本矩阵fundamental matrix或者本质矩阵essential matrix,再利用全部特征点对(Xi,X'i)对该预估结果进行测试,假设所有的特征点对中包含局内点和局外点,其中局内点近似的符合预估结果所在的直线,而局外点远离于预估结果直线。此时即可不断进行迭代,以求出更好的预估结果,而不符合预估结果的特征点对则被舍弃。
获得相对平移距离t和相对旋转矩阵R之后,还需要利用获取的相对平移距离t和相对旋转矩阵R对特征点进行验算,以获取更准确的t和R。具体的,验算过程可包括如下步骤:
1)根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,第一图像中的特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,而当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,第二图像中特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i
2)根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值。
3)根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R。
当特征点到该特征点对应核线的第一距离与第二距离的差大于设定方差阈值时,说明该特征点与其余特征点的差别较大,此时应舍弃该特征点,并利用其余特征点重新获取两个摄像头之间的相对平移距离t和相对旋转矩阵R。
然后,重复执行上述步骤,并对计算结果进行验证,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离之间的差均小于设定方差阈值。
S104、在Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
获取最优双摄像头相对位置参数具体包括:
1)获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000035
其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像。
具体的,第一图像中的特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,第二图像中的特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i
进一步的,可以根据
Figure PCTCN2016075949-appb-000036
获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000037
其中Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000038
N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
2)将平均误差
Figure PCTCN2016075949-appb-000039
最小的双摄像头相对位置参数作为最优双摄像头相对位置参数。
经过上述各步骤之后,即可获取最优的双摄像头位置参数。该最优的双摄像头位置参数表示了双摄像头中一个摄像头与另外一个摄像头之间的相对位置关系。
进一步的,在获取最优双摄像头相对位置参数之后,还包括:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000040
其中,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,参考图像为双摄像头拍摄的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000041
大于或等于所述预定误差阈值,重新执行双摄像头位置计算方法。
本实施例中,首先获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由该双摄像头分别同时对同一场景拍摄的两幅图像,再对M组双摄像头图像进行筛选,获得Q组可用于计算双摄像头相对位置的双摄像头图像,其中M、Q都为正整数,且Q≤M;然后根据Q组中的每组双摄像头图像获得Q组中每组双摄像头图像所对应的双摄像头相对位置参数,最后在Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。这样可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算。
图2是本发明实施例二提供的双摄像头位置计算方法的流程示意图。本实施例在上述实施例的基础上,详细提供了对双摄像头进行位置计算的方法流程的具体步骤。如图2所示,本实施例提供的双摄像头位置计算方法包括:
S201、获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像。
在利用双摄像头进行摄像时,对于同一场景,两个摄像头可以同时分别拍摄以得到两幅图像。这两幅图像所拍摄的场景范围与内容均大致相同,只是视角有一定偏差。
一般的,可以利用预定程序对获取的双摄像头图像的组数进行设定。例如 是可以设置使双摄像头抓取M组图像,M的值可以在配置文件中进行设定。获取M组图像之后,该M组图像在后续步骤中进行筛选计算。
S202、对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像。
因为拍摄到的双摄像头图像并不一定适合用来计算双摄像头的相对位置,所以获取了多组双摄像头图像之后,还需要针对每一组双摄像头进行筛选,以获取多组满足预设条件,从而可用于计算双摄像头相对位置的双摄像头图像,以进行后续的双摄像头位置计算过程。例如,下面几种情况均不适于进行后续的双摄像头位置计算:
1)被摄场景或物体离双摄像头太远;
2)被摄场景或者场景的主要部分是平面或者接近平面;
3)被摄场景没有纹理丰富的物体。
上述情形中,双摄像头中两个摄像头所拍摄到的场景或物体存在较为相似、反差度较低等状况,即两个摄像头所拍摄出来的物体难以进行区分或者分辨,因而需要借助投影误差等可以表征两个图像相似度的参数,将区分度过低,无法实现位置计算的图像筛选出来,从而过滤上述不能用于计算的场景或物体。
图3是本发明实施例二提供的对每组双摄像头图像进行筛选的流程示意图。如图3所示,该步骤还可以具体包括:
S301、获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像。
因为单应性矩阵H满足如下关系:
Figure PCTCN2016075949-appb-000042
其中,
Figure PCTCN2016075949-appb-000043
将上述关系式展开后,可得
x'i(H31x1+H32y1+H33)=H11x1+H12y1+H13
y'i(H31x1+H32y1+H33)=H21x1+H22y1+H23
整理后可得到:
Bh=0
其中
h=(H11,H12,H13,H21,H22,H23,H31,H32,H33)T
Figure PCTCN2016075949-appb-000044
bx=(-x1,-y1-1,0,0,0,x'1x1,x'1y1,x'2)T
by=(0,0,0,-x1,-y1,-1,y'1x1,y'1y1,y'1)T
N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数。
获得特征点对之后,即可以根据最小二乘法或者梯度下降法解出h,并进而得到相关性矩阵H。
S302、根据单应性矩阵确定每组双摄像头图像中两幅图像之间的投影误差。
具体可以根据公式
Figure PCTCN2016075949-appb-000045
确定投影误差e,其中,H表示每组双摄像头图像所对应的单应性矩阵,Yi表示双摄像头图像中第一图像的特征点(xi,yi),Y'i表示双摄像头图像中第二图像的特征点(x'i,y'i),j为正整数,j≤N',N'表示每组双摄像头图像中特征点对(Yi,Y'i)的个数,其中第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
S303、当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于计算双摄像头相对位置的双摄像头图像。
根据上述步骤获得第一组双摄像头图像中两幅图像间的投影误差e后,即可将该投影误差e与预先设定的预定误差阈值进行比较,当投影误差e大于或等于 预定误差阈值时,可确定该第一组图像为可用于计算双摄像头相对位置的双摄像头图像,然后可用该第一组图像进行后续的双摄像头位置计算;当投影误差e小于预定误差阈值时,确定该第一组图像不满足预设条件,不能用于后续双摄像头相对位置计算。
进一步的,当可用于计算双摄像头相对位置的双摄像头图像的数量小于或等于规定阈值时,为了防止因样本过少而导致后续计算出现问题,还需要重新获取M组双摄像头图像,以重新进行计算。例如如果可用于位置计算的图像的组数为Q,而规定阈值为L,当Q≤L时,说明获得的Q组图像中,合理的图像太少,需要重新再抓取M组图像。
S203、根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数。
获取了可用于计算双摄像头相对位置参数的Q组中的每组双摄像头图像后,即可根据每一组可用于位置计算的双摄像头图像获得双摄像头图像所对应的双摄像头相对位置参数。图4是本发明实施例二提供的获得双摄像头图像所对应的相对位置参数的流程示意图。如图4所示,根据Q组中每组双摄像头图像获得双摄像头图像所对应的双摄像头相对位置参数,具体包括:
S401、根据第二组双摄像头图像中的特征点对获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像。
具体的,第二组双摄像头图像中的特征点对为(Xi,X'i),Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),t=(tx,ty,tz)T
具体的,双摄像头图像中的特征点对(Xi,X'i)满足下列关系:
Figure PCTCN2016075949-appb-000046
并且存在已知关系:
F=K'-T[t]xRK-1
其中,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000047
因而,可以由两个摄像头的内参矩阵K,K'以及特征点对(Xi,X'i)对两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R进行求解。
具体的,该步骤可以包括:
1)根据随机抽样一致算法剔除错误的双摄像头图像中的特征点对(Xi,X'i);
该步骤为可选步骤,其具体过程为利用已知的随机抽样一致算法查找出错误的特征点对(Xi,X'i)并删除,以确保进行后续计算。
2)根据
Figure PCTCN2016075949-appb-000048
获得t和R,其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000049
N表示每一组双摄像头图像中特征点对(Xi,X'i)的个数。
具体的,上述公式中,li向量的第一分量lia和第二分量lib分别可以是li向量进行分解后的不同方向上的分量,例如进行正交分解后,在两个相互正交的方向上所产生的分量,同理,l'i向量的第一分量l'ia和第二分量l'ib也可以是将l'i向量进行正交分解后,所产生的正交方向上的两个分量。
上述方程的求解,可以采用非线性最小二乘法进行求解,例如列文伯格-马夸尔特(Levenberg-Marquardt)算法等。
S402、根据相对平移距离t和相对旋转矩阵R获得第二组双摄像头图像中每一个特征点的第一距离,其中第一距离为每一个特征点到与该特征点对应的核线的距离;
具体的,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在 第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi;当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i
S403、根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值。
其中,特征点Xi对应的核线为l'i=K'-T[t]xRK-1Xi,特征点X'i对应的核线为li=-K-TR-1[t]xK'-1X'i
S404、根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R。
当特征点的第一距离与第二距离的差大于设定方差阈值,例如是距离平均值的三倍方差时,说明该特征点与其余特征点的差别较大,此时应舍弃该特征点,并利用第一距离与第二距离的差小于或等于设定方差阈值的其余特征点,重新获取两个摄像头之间的相对平移距离t和相对旋转矩阵R。
S405、重复上述过程,直至第二组双摄像头图像中的每一个特征点的第一距离与第二距离的差均小于设定方差阈值。
该步骤中,重复S401至S404步骤,并对计算结果进行验证,直至第二组双摄像头图像中每一个特征点到特征点对应核线的第一距离与第二距离之间的差均小于设定方差阈值,此时说明双摄像头图像中每一个特征点到特征点对应核线的距离均接近一致。
S204、在Q组双摄像头图像所对应的相对位置参数中获取最优相对位置参数。
获取最优相对位置参数具体包括:
1)根据
Figure PCTCN2016075949-appb-000050
获取第二组双摄像头图像中特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000051
其中Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000052
N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
2)将平均误差
Figure PCTCN2016075949-appb-000053
最小的双摄像头图像的双摄像头相对位置参数作为最优双摄像头相对位置参数。
经过上述各步骤之后,即可获取最优的双摄像头位置参数。
在获取了双摄像头图像的最优双摄像头相对位置参数之后,为了确保该最优的双摄像头相对位置参数有效,需要进行验算过程。图5是本发明实施例二提供的对最优双摄像头相对位置参数进行验算的流程示意图。如图5所示,对双摄像头的最优相对位置参数进行验算可以包括以下步骤:
S501、根据最优双摄像头相对位置参数获取参考图像中所有特征点的第一距离的参考平均误差,其中参考图像为双摄像头所拍摄的在M组双摄像头图像之外的图像;
S502、若参考平均误差大于或等于所述预定误差阈值,重新执行双摄像头位置计算方法。
得到最优双摄像头相对位置参数后,即可重新采集一组双摄像头图像,该组双摄像头图像并不属于上述M组双摄像头图像之一,并根据该最优相对位置参数获得该重新采集的独立双摄像头图像中的特征点的第一距离的独立平均误差
Figure PCTCN2016075949-appb-000054
如果
Figure PCTCN2016075949-appb-000055
大于预定的误差阈值,则说明该最优相对位置参数并不能适用于其他图像,需要重新执行双摄像头位置计算方法,以得到新的最优双摄像头相对位置参数。经过上述验算步骤后,即可得到最终的最优双摄像头相对位置参数。
本实施例中,以具体的对双摄像头进行位置计算过程为例,详细说明了双摄像头位置计算方法的具体流程。该双摄像头位置计算方法具体包括:首先获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由该双摄像头分别同时对同一场景拍摄的两幅图像,再对M组双摄像头图像进行筛选,获取Q组可用于计算双摄像头相对位置的双摄像头图像,其中Q≤M,然后根据Q组中的 每组双摄像头图像获取双摄像头图像所对应的双摄像头相对位置参数,最后在所有双摄像头图像所对应的双摄像头相对位置参数中获取最优双摄像头相对位置参数。这样采用本实施例的详细方法流程,可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算。
图6是本发明实施例三提供的双摄像头相对位置计算装置的结构示意图。本实施例所提供的双摄像头相对位置计算装置可以执行前述实施例一和二所述的方法流程。如图6所示,本实施例提供的双摄像头位置计算装置61包括:
采集模块601,用于获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,M为正整数;
筛选模块602,用于对该M组双摄像头图像进行筛选,得到Q组可用于位置计算双摄像头相对位置的双摄像头图像,其中Q为正整数,Q≤M;
位置计算模块603,用于根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数;
优化模块604,用于从Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
具体的,相对位置参数包括两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
具体的,筛选模块602具体可以用于:
获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于计算双摄像头相对位置的双摄像头图像。
进一步的,筛选模块602可以用于:根据
Figure PCTCN2016075949-appb-000056
确定第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示第一组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄像头图像中的第一图像的特征点(xi,yi), Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y'i),第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像,j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数。
具体的,位置计算模块603具体可以用于:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,Xi表示第二组双摄像头图像中第一图像中的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
进一步的,位置计算模块603具体可以用于:
根据非线性优化公式
Figure PCTCN2016075949-appb-000057
获得t和R,其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000058
N表示双摄像头图像中特征点对(Xi,X'i)的个数。
进一步的,在根据上述非线性优化公式
Figure PCTCN2016075949-appb-000059
获取t和R之前,位置计算模块603还用于:根据RANSCA算法剔除第二组双摄像头图像中错误的特征点对(Xi,X'i)。
在根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R之后,位置计算模块603还 用于:
根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i
根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值;
根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R;
重复上述过程,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离的平均值的差均小于设定方差阈值。
具体的,优化模块604具体用于:
获得第二组双摄像头图像中所有特征点到核线距离的平均误差
Figure PCTCN2016075949-appb-000060
其中第一距离为每一个特征点到与该特征点对应的核线的距离,Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
将平均误差
Figure PCTCN2016075949-appb-000061
最小的双摄像头图像的双摄像头相对位置参数作为最优双摄像头相对位置参数。
进一步的,优化模块604用于根据
Figure PCTCN2016075949-appb-000062
获得第二组双摄像头图像中特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000063
其中
Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000064
i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
具体的,采集模块601还用于:当可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,重新获取M组双摄像头图像。
具体的,在获取最优相对位置参数之后,优化模块604还用于:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000065
其中参考图像为双摄像头所拍摄的在获取的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000066
大于或等于预定误差阈值,重新执行双摄像头位置计算方法。
本实施例中,双摄像头相对位置计算装置中的采集模块用于获取多M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像;筛选模块用于对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像;位置计算模块用于根据Q组中的每组可用于位置计算的双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数;优化模块用于在所有双摄像头相对位置参数中获取最优双摄像头相对位置参数。这样该双摄像头相对位置计算装置可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算
图7是本发明实施例四提供的电子设备的结构示意图。本实施例所提供的电子设备可以执行前述实施例一和二所述的方法流程。如图7所示,本实施例提供的电子设备71包括:
双摄像头701,该双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像;
一个或多个处理器702;
存储器703;
以及一个或多个程序,其中一个或多个程序被存储在存储器703中并被配置为被一个或多个处理器702执行,这一个或多个程序包括用于执行根据前述实施例所述的双摄像头相对位置计算方法的指令。
具体的,该双摄像头相对位置计算方法的指令包括:
获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,其中M为正整数;
对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像,其中Q为正整数,且Q≤M;
根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数;
从Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
具体的,相对位置参数包括两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
具体的,对每组双摄像头图像进行筛选,以获得多组可用于相对位置计算的双摄像头图像具体包括:
获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于计算双摄像头相对位置的双摄像头图像。
进一步的,根据单应性矩阵确定每组双摄像头图像中两幅图像之间的投影误差具体包括:
根据
Figure PCTCN2016075949-appb-000067
确定第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示第一组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄 像头图像中的第一图像的特征点(xi,yi),Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y'i),j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
具体的,根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数具体包括:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),其中,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
进一步的,根据Q组中每组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R具体包括:根据非线性优化公式
Figure PCTCN2016075949-appb-000068
获取t和R,
其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000069
进一步的,在根据非线性优化公式
Figure PCTCN2016075949-appb-000070
获取t和R 之前,还可以包括:
根据随机抽样一致RANSAC算法剔除第二组双摄像头图像中错误的特征点对(Xi,X'i)。
进一步的,在根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R之后,还包括:
根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中第一距离为每一个特征点到与该特征点对应的核线的距离,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi,当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i
根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值;
根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R;
重复上述过程,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离的平均值的差均小于设定方差阈值。
具体的,获取最优双摄像头相对位置参数具体包括:
获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000071
其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i),N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数;
将平均误差
Figure PCTCN2016075949-appb-000072
最小的双摄像头图像的相对位置参数作为最优双摄像头相对位置参数。
进一步的,获得每个双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000073
具体包括:
根据
Figure PCTCN2016075949-appb-000074
获得第二组双摄像头图像中特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000075
其中
Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为xi'在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000076
i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
具体的,当可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,应重新获取M组双摄像头图像。
具体的,在获取最优双摄像头相对位置参数之后,还包括:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000077
其中,第一距离为每一个特征点到与该特征点对应的核线的距离,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,参考图像为双摄像头所拍摄的在获取的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000078
大于或等于预定误差阈值,重新执行双摄像头位置计算方法。
本实施例中,电子设备71包括:双摄像头701,该双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像;一个或多个处理器702;存储器703;以及一个或多个程序,其中一个或多个程序被存储在存储器703中并被配置为 被一个或多个处理器702执行,这一个或多个程序包括用于执行根据前述实施例所述的双摄像头相对位置计算方法的指令。这样电子设备可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算。
另一方面,本发明还提供一种存储一个或多个程序的计算机可读存储介质,这一个或多个程序包括指令,指令当被包括双摄像头和多个应用程序的电子设备执行时,使电子设备执行根据前面实施例中所述的双摄像头相对位置计算方法,其中,双摄像头用于以两个摄像头拍摄同一场景。
指令被电子设备执行时,电子设备执行的双摄像头相对位置计算方法包括:
获取M组双摄像头图像,其中M组中的每组双摄像头图像包括由双摄像头分别同时对同一场景拍摄的两幅图像,其中M为正整数;
对M组双摄像头图像进行筛选,得到Q组可用于计算双摄像头相对位置的双摄像头图像,其中Q为正整数,且Q≤M;
根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数;
从Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
具体的,相对位置参数包括两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
具体的,对每组双摄像头图像进行筛选,以获得多组可用于相对位置计算的双摄像头图像具体包括:
获取第一组双摄像头图像所对应的单应性矩阵,其中,M组双摄像头图像中的每组双摄像头图像为第一组双摄像头图像;
根据单应性矩阵确定第一组双摄像头图像中两幅图像之间的投影误差;
当投影误差大于或等于预定误差阈值时,确定第一组双摄像头图像为可用于计算双摄像头相对位置的双摄像头图像。
进一步的,根据单应性矩阵确定每组双摄像头图像中两幅图像之间的投影误差具体包括:
根据
Figure PCTCN2016075949-appb-000079
确定第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示第一组双摄像头图像所对应的单应性矩阵,Yi表示第一组双摄像头图像中的第一图像的特征点(xi,yi),Y'i表示第一组双摄像头图像中第二图像的特征点(x'i,y′ii),j为正整数,j≤N',N'表示第一组双摄像头图像中特征点对(Yi,Y'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
具体的,根据Q组中的每组双摄像头图像获取Q组中的每组双摄像头图像所对应的双摄像头相对位置参数具体包括:
根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R,其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),其中,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,第一图像为两个摄像头中第一摄像头拍摄的图像,第二图像为两个摄像头中第二摄像头拍摄的图像。
进一步的,根据Q组中每组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R具体包括:根据非线性优化公式
Figure PCTCN2016075949-appb-000080
获取t和R,
其中
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为X'i在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x 为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000081
进一步的,在根据非线性优化公式
Figure PCTCN2016075949-appb-000082
获取t和R之前,还可以包括:
根据随机抽样一致RANSAC算法剔除第二组双摄像头图像中错误的特征点对(Xi,X'i)。
进一步的,在根据第二组双摄像头图像中的特征点对(Xi,X'i)获得两个摄像头之间的相对平移距离t和两个摄像头之间的相对旋转矩阵R之后,还包括:
根据相对平移距离t和相对旋转矩阵R获取第二组双摄像头图像中每一个特征点的第一距离,其中第一距离为每一个特征点到与该特征点对应的核线的距离,当每一个特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一个特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i
根据每一个特征点的第一距离获得第二距离,第二距离为所有特征点的第一距离的平均值;
根据第一距离和第二距离的差小于或等于设定方差阈值的特征点,重新获取相对平移距离t和相对旋转矩阵R;
重复上述过程,直至第二组双摄像头图像中每一个特征点的第一距离与第二距离的平均值的差均小于设定方差阈值。
具体的,获取最优双摄像头相对位置参数具体包括:
获得第二组双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000083
其中Q组双摄像头图像中的每组双摄像头图像为第二组双摄像头图像,第一距离为每一个特征点到与该特征点对应的核线的距离,当每一特征点为特征点对(Xi,X'i)中的特征点Xi时,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,当每一特征点为特征点对(Xi,X'i)中的特征点X'i时,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中的第二图像的特征点(x'i,y'i), N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数;
将平均误差
Figure PCTCN2016075949-appb-000084
最小的双摄像头图像的相对位置参数作为最优双摄像头相对位置参数。
进一步的,获得每个双摄像头图像中所有特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000085
具体包括:
根据
Figure PCTCN2016075949-appb-000086
获得第二组双摄像头图像中特征点的第一距离的平均误差
Figure PCTCN2016075949-appb-000087
其中
Xi表示第二组双摄像头图像中第一图像的特征点(xi,yi),X'i表示第二组双摄像头图像中第二图像的特征点(x'i,y'i),
l'i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
li=-K-TR-1[t]xK'-1X'i为xi'在第一图像中对应的核线,
lia,lib分别为li向量的第一分量和第二分量,l'ia,l'ib分别为l'i向量的第一分量和第二分量,K为第一摄像头的内参矩阵,K'为第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
Figure PCTCN2016075949-appb-000088
i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数。
具体的,当可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,应重新获取M组双摄像头图像。
具体的,在获取最优双摄像头相对位置参数之后,还包括:
根据最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
Figure PCTCN2016075949-appb-000089
其中,第一距离为每一个特征点到与该特征点对应的核线的距离,特征点Xi在第二图像中对应的核线为l'i=K'-T[t]xRK-1Xi,特征点X'i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X'i,i为正整数,i≤N,N表示第二组双摄像头图像中特征点对(Xi,X'i)的个数,参考图像为双摄像头所拍摄的在获取的M组双摄像头图像之外的图像;
若参考平均误差
Figure PCTCN2016075949-appb-000090
大于或等于预定误差阈值,重新执行双摄像头位置计算方法。
本实施例中,存储一个或多个程序的计算机可读存储介质,这一个或多个程序包括指令,指令当被包括双摄像头和多个应用程序的电子设备执行时,使电子设备执行根据前面实施例中所述的双摄像头相对位置计算方法,其中,双摄像头用于以两个摄像头拍摄同一场景。这样双摄像头位置计算装置可以在拍摄场景较难分辨的情况下,实现双摄像头相对位置的计算。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (26)

  1. 一种双摄像头相对位置计算方法,其特征在于,包括:
    获取M组双摄像头图像,其中所述M组中的每组双摄像头图像包括由所述双摄像头分别同时对同一场景拍摄的两幅图像,其中M为正整数;
    对所述M组双摄像头图像进行筛选,得到Q组可用于计算所述双摄像头相对位置的双摄像头图像,其中Q为正整数,且Q≤M;
    根据所述Q组中的每组双摄像头图像获取所述Q组中的每组双摄像头图像所对应的所述双摄像头相对位置参数;
    从所述Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
  2. 根据权利要求1所述的双摄像头相对位置计算方法,其特征在于,所述相对位置参数包括所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
  3. 根据权利要求1或2所述的双摄像头相对位置计算方法,其特征在于,所述对所述M组双摄像头图像进行筛选,得到Q组可用于计算所述双摄像头相对位置的双摄像头图像具体包括:
    获取第一组双摄像头图像所对应的单应性矩阵,其中,所述M组双摄像头图像中的每组双摄像头图像为所述第一组双摄像头图像;
    根据所述单应性矩阵确定所述第一组双摄像头图像中两幅图像之间的投影误差;
    当所述投影误差大于或等于预定误差阈值时,确定所述第一组双摄像头图像为可用于计算所述双摄像头相对位置的双摄像头图像。
  4. 根据权利要求3所述的双摄像头相对位置计算方法,其特征在于,所述根据所述单应性矩阵确定所述第一组双摄像头图像中两幅图像之间的投影误差具体包括:
    根据
    Figure PCTCN2016075949-appb-100001
    确定所述第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示所述第一组双摄像头图像所对应的单应性矩阵,Yi表示 所述第一组双摄像头图像中的第一图像的特征点(xi,yi),Y′i表示所述第一组双摄像头图像中的第二图像的特征点(x′i,y′i),j为正整数,j≤N',N'表示所述第一组双摄像头图像中特征点对(Yi,Y′i)的个数,所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像。
  5. 根据权利要求1至4任一项所述的双摄像头相对位置计算方法,其特征在于,所述根据所述Q组中的每组双摄像头图像获取所述Q组中的每组双摄像头图像所对应的所述双摄像头相对位置参数具体包括:
    根据第二组双摄像头图像中的特征点对(Xi,X′i)获得所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R,其中所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,Xi表示所述第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中的第二图像的特征点(x′i,y′i),其中,i为正整数,i≤N,N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数,所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像。
  6. 根据权利要求5所述的双摄像头相对位置计算方法,其特征在于,所述根据所述第二组双摄像头图像中的特征点对(Xi,X′i)获得所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R具体包括:
    根据非线性优化公式
    Figure PCTCN2016075949-appb-100002
    获取所述t和R,
    其中
    l′i=K'-T[t]xRK-1Xi为Xi在所述第二图像中对应的核线,
    li=-K-TR-1[t]xK'-1X′i为X′i在所述第一图像中对应的核线,
    lia,lib分别为所述li向量的第一分量和第二分量,l′ia,l′ib分别为所述l′i向量的第一分量和第二分量,K为所述第一摄像头的内参矩阵,K'为所述第二摄像 头的内参矩阵,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100003
  7. 根据权利要求6所述的双摄像头相对位置计算方法,其特征在于,所述根据非线性优化公式
    Figure PCTCN2016075949-appb-100004
    获取所述t和R之前,还包括:
    根据随机抽样一致RANSAC算法剔除所述第二组双摄像头图像中错误的特征点对(Xi,X′i)。
  8. 根据权利要求5-7任一项所述的双摄像头相对位置计算方法,其特征在于,所述根据所述第二组双摄像头图像中的特征点对(Xi,X′i)获得所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R之后,还包括:
    根据所述相对平移距离t和所述相对旋转矩阵R获取所述第二组双摄像头图像中每一个特征点的第一距离,其中所述第一距离为所述每一个特征点到与该特征点对应的核线的距离;
    当所述每一个特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在所述第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi
    当所述每一个特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i在所述第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i
    其中,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100005
    根据所述每一个特征点的第一距离获得第二距离,所述第二距离为所有特征点的第一距离的平均值;
    根据所述第一距离和所述第二距离的差小于或等于设定方差阈值的特征点,重新获取所述相对平移距离t和所述相对旋转矩阵R;
    重复上述过程,直至所述第二组双摄像头图像中每一个特征点的第一距离与第二距离的平均值的差均小于设定方差阈值。
  9. 根据权利要求1至8任一项所述的双摄像头相对位置计算方法,其特征在于,所述获取最优双摄像头相对位置参数具体包括:
    获得第二组双摄像头图像中所有特征点的第一距离的平均误差
    Figure PCTCN2016075949-appb-100006
    其中所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,所述第一距离为所述每一个特征点到与该特征点对应的核线的距离,
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi,
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i
    i为正整数,i≤N,Xi表示所述第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中的第二图像的特征点(x′i,y′i),N表示所述第二组双摄像头图像中的特征点对(Xi,X′i)的个数,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100007
    所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像;
    将所述平均误差
    Figure PCTCN2016075949-appb-100008
    最小的所述双摄像头图像的相对位置参数作为最优双摄像头相对位置参数。
  10. 根据权利要求9所述的双摄像头相对位置计算方法,其特征在于,所述获得所述第二组双摄像头图像中所有特征点的第一距离的平均误差
    Figure PCTCN2016075949-appb-100009
    具体包括:
    根据
    Figure PCTCN2016075949-appb-100010
    获得所述第二组双摄像头图像中特征点的第一 距离的平均误差
    Figure PCTCN2016075949-appb-100011
    其中
    Xi表示所述第二组双摄像头图像中第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中第二图像的特征点(x′i,y′i),所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像,
    l′i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
    li=-K-TR-1[t]xK'-1X′i为X′i在第一图像中对应的核线,
    lia,lib分别为所述li向量的第一分量和第二分量,l′ia,l′ib分别为所述l′i向量的第一分量和第二分量,K为所述第一摄像头的内参矩阵,K'为所述第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100012
    N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数。
  11. 根据权利要求1至10任一项所述的双摄像头相对位置计算方法,其特征在于,当所述可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,重新获取M组双摄像头图像。
  12. 根据权利要求1至11任一项所述的双摄像头相对位置计算方法,其特征在于,在所述获取最优双摄像头相对位置参数之后,还包括:
    根据所述最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
    Figure PCTCN2016075949-appb-100013
    其中,所述第一距离为每一个特征点到与该特征点对应的核线的距离,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示第二组双摄像头图像中的第二图像的特征点(x′i,y′i),所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在所述第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi,
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i 在所述第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i,i为正整数,i≤N,N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100014
    所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像,所述参考图像为所述双摄像头所拍摄的在所述获取的M组双摄像头图像之外的图像;
    若所述参考平均误差
    Figure PCTCN2016075949-appb-100015
    大于或等于所述预定误差阈值,重新执行所述双摄像头位置计算方法。
  13. 一种双摄像头相对位置计算装置,其特征在于,包括:
    采集模块,用于获取M组双摄像头图像,其中所述M组中的每组双摄像头图像包括由所述双摄像头分别同时对同一场景拍摄的两幅图像,其中M为正整数;
    筛选模块,用于对所述M组双摄像头图像进行筛选,得到Q组可用于计算所述双摄像头相对位置的双摄像头图像,其中Q为正整数,且Q≤M;
    位置计算模块,用于根据所述Q组中的每组双摄像头图像获取所述Q组中的每组双摄像头图像所对应的所述双摄像头相对位置参数;
    优化模块,用于从所述Q组双摄像头相对位置参数中获取最优双摄像头相对位置参数。
  14. 根据权利要求13所述的双摄像头相对位置计算装置,其特征在于,所述相对位置参数包括所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R,其中,t=(tx,ty,tz)T,x、y和z分别为平面直角坐标系的三个正交坐标轴。
  15. 根据权利要求13或14所述的双摄像头相对位置计算装置,其特征在于,所述筛选模块具体用于:
    获取第一组双摄像头图像所对应的单应性矩阵,其中,所述M组双摄像头图像中的每组双摄像头图像为所述第一组双摄像头图像;
    根据所述单应性矩阵确定所述第一组双摄像头图像中两幅图像之间的投影误差;
    当所述投影误差大于或等于预定误差阈值时,确定所述第一组双摄像头图像为可用于计算所述双摄像头相对位置的双摄像头图像。
  16. 根据权利要求15所述的双摄像头相对位置计算装置,其特征在于,所述筛选模块具体用于:根据
    Figure PCTCN2016075949-appb-100016
    确定所述第一组双摄像头图像中两幅图像之间的投影误差e,其中,H表示所述第一组双摄像头图像所对应的单应性矩阵,Yi表示所述第一组双摄像头图像中的第一图像的特征点(xi,yi),Y′i表示所述第一组双摄像头图像中第二图像的特征点(x′i,y′i),j为正整数,j≤N',N'表示所述第一组双摄像头图像中特征点对(Yi,Y′i)的个数,所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像。
  17. 根据权利要求13至16任一项所述的双摄像头相对位置计算装置,其特征在于,所述位置计算模块具体用于:
    根据第二组双摄像头图像中的特征点对(Xi,X′i)获得所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R,其中所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,Xi表示所述第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中的第二图像的特征点(x′i,y′i),i为正整数,i≤N,N表示所述第二组双摄像头图像中的特征点对(Xi,X′i)的个数,所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像。
  18. 根据权利要求17所述的双摄像头相对位置计算装置,其特征在于,所述位置计算模块具体用于:
    根据非线性优化公式
    Figure PCTCN2016075949-appb-100017
    获得所述t和R,其中
    l′i=K'-T[t]xRK-1Xi为Xi在所述第二图像中对应的核线,
    li=-K-TR-1[t]xK'-1X′i为X′i在所述第一图像中对应的核线,
    lia,lib分别为所述li向量的第一分量和第二分量,l′ia,l′ib分别为所述l′i向量的第一分量和第二分量,K为所述第一摄像头的内参矩阵,K'为所述第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100018
  19. 根据权利要求18所述的双摄像头相对位置计算装置,其特征在于,所述根据非线性优化公式
    Figure PCTCN2016075949-appb-100019
    获取所述t和R之前,所述位置计算模块还用于:根据RANSCA算法剔除所述第二组双摄像头图像中错误的特征点对(Xi,X′i)。
  20. 根据权利要求17-19任一项所述的双摄像头相对位置计算装置,其特征在于,所述根据所述第二组双摄像头图像中的特征点对(Xi,X′i)获得所述两个摄像头之间的相对平移距离t和所述两个摄像头之间的相对旋转矩阵R之后,所述位置计算模块还用于:
    根据所述相对平移距离t和所述相对旋转矩阵R获取所述第二组双摄像头图像中每一个特征点的第一距离,其中所述第一距离为所述每一个特征点到与该特征点对应的核线的距离;
    当所述每一个特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在所述第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi
    当所述每一个特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i在所述第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i
    其中,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100020
    根据所述每一个特征点的第一距离获得第二距离,所述第二距离为所有特征点的第一距离的平均值;
    根据所述第一距离和所述第二距离的差小于或等于设定方差阈值的特征点,重新获取所述相对平移距离t和所述相对旋转矩阵R;
    重复上述过程,直至所述第二组双摄像头图像中每一个特征点的第一距离与第二距离的差均小于设定方差阈值。
  21. 根据权利要求13至20任一项所述的双摄像头相对位置计算装置,其特征在于,所述优化模块具体用于:
    获得第二组双摄像头图像中所有特征点的第一距离的平均误差
    Figure PCTCN2016075949-appb-100021
    其中所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,所述第一距离为每一个特征点到与该特征点对应的核线的距离;
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i在第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i,i为正整数,i≤N,Xi表示所述第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中的第二图像的特征点(x′i,y′i),N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100022
    所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像;
    将所述平均误差
    Figure PCTCN2016075949-appb-100023
    最小的所述双摄像头图像的双摄像头相对位置参数作为最优双摄像头相对位置参数。
  22. 根据权利要求21所述的双摄像头相对位置计算装置,其特征在于,所述优化模块具体用于:
    根据
    Figure PCTCN2016075949-appb-100024
    获得所述第二组双摄像头图像中特征点的第一 距离的平均误差
    Figure PCTCN2016075949-appb-100025
    其中
    Xi表示所述第二组双摄像头图像中第一图像的特征点(xi,yi),X′i表示所述第二组双摄像头图像中第二图像的特征点(x′i,y′i),所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像,
    l′i=K'-T[t]xRK-1Xi为Xi在第二图像中对应的核线,
    li=-K-TR-1[t]xK'-1X′i为X′i在第一图像中对应的核线,
    lia,lib分别为所述li向量的第一分量和第二分量,l′ia,l′ib分别为所述l′i向量的第一分量和第二分量,K为所述第一摄像头的内参矩阵,K'为所述第二摄像头的内参矩阵,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100026
    i为正整数,i≤N,N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数。
  23. 根据权利要求13至22任一项所述的双摄像头相对位置计算装置,其特征在于,所述采集模块还用于:当所述可用于位置计算的双摄像头图像的数量小于或等于规定阈值时,重新获取M组双摄像头图像。
  24. 根据权利要求13至23任一项所述的双摄像头相对位置计算装置,其特征在于,在所述获取最优相对位置参数之后,所述优化模块还用于:
    根据所述最优双摄像头相对位置参数获得参考图像中所有特征点的第一距离的参考平均误差
    Figure PCTCN2016075949-appb-100027
    其中,所述第一距离为每一个特征点到与该特征点对应的核线的距离,Xi表示第二组双摄像头图像中的第一图像的特征点(xi,yi),X′i表示第二组双摄像头图像中的第二图像的特征点(x′i,y′i),所述Q组双摄像头图像中的每组双摄像头图像为所述第二组双摄像头图像,
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点Xi时,所述特征点Xi在所述第二图像中对应的核线为l′i=K'-T[t]xRK-1Xi
    当所述每一特征点为所述特征点对(Xi,X′i)中的特征点X′i时,所述特征点X′i在所述第一图像中对应的核线为li=-K-TR-1[t]xK'-1X′i,i为正整数,i≤N,N表示所述第二组双摄像头图像中特征点对(Xi,X′i)的个数,[t]x为由t定义的反对称矩阵
    Figure PCTCN2016075949-appb-100028
    所述第一图像为所述两个摄像头中第一摄像头拍摄的图像,所述第二图像为所述两个摄像头中第二摄像头拍摄的图像,所述参考图像为所述双摄像头所拍摄的在所述获取的M组双摄像头图像之外的图像;
    若所述参考平均误差
    Figure PCTCN2016075949-appb-100029
    大于或等于所述预定误差阈值,重新执行所述双摄像头位置计算方法。
  25. 一种电子设备,包括:
    双摄像头,所述双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像;
    一个或多个处理器;
    存储器;
    以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为被所述一个或多个处理器执行,所述一个或多个程序包括用于执行根据权利要求1至12任一项所述的双摄像头相对位置计算方法的指令。
  26. 一种存储一个或多个程序的计算机可读存储介质,所述一个或多个程序包括指令,所述指令当被包括双摄像头和多个应用程序的电子设备执行时使所述电子设备执行根据权利要求1至12任一项所述的双摄像头相对位置计算方法,其中,所述双摄像头用于以两个摄像头对同一场景分别同时拍摄两幅图像。
PCT/CN2016/075949 2015-07-15 2016-03-09 双摄像头相对位置计算方法、装置和设备 WO2017008516A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP16823664.4A EP3252715B1 (en) 2015-07-15 2016-03-09 Two-camera relative position calculation system, device and apparatus
US15/572,375 US10559090B2 (en) 2015-07-15 2016-03-09 Method and apparatus for calculating dual-camera relative position, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510416283.2A CN106709899B (zh) 2015-07-15 2015-07-15 双摄像头相对位置计算方法、装置和设备
CN201510416283.2 2015-07-15

Publications (1)

Publication Number Publication Date
WO2017008516A1 true WO2017008516A1 (zh) 2017-01-19

Family

ID=57757775

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/075949 WO2017008516A1 (zh) 2015-07-15 2016-03-09 双摄像头相对位置计算方法、装置和设备

Country Status (4)

Country Link
US (1) US10559090B2 (zh)
EP (1) EP3252715B1 (zh)
CN (1) CN106709899B (zh)
WO (1) WO2017008516A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875451A (zh) * 2017-02-27 2017-06-20 安徽华米信息科技有限公司 相机标定方法、装置及电子设备

Families Citing this family (49)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105556944B (zh) 2012-11-28 2019-03-08 核心光电有限公司 多孔径成像系统和方法
CN109194849B (zh) 2013-06-13 2021-01-15 核心光电有限公司 双孔径变焦数字摄影机
KR101757101B1 (ko) 2013-07-04 2017-07-12 코어포토닉스 리미티드 소형 망원 렌즈 조립체
WO2015015383A2 (en) 2013-08-01 2015-02-05 Corephotonics Ltd. Thin multi-aperture imaging system with auto-focus and methods for using same
US9392188B2 (en) 2014-08-10 2016-07-12 Corephotonics Ltd. Zoom dual-aperture camera with folded lens
WO2016108093A1 (en) 2015-01-03 2016-07-07 Corephotonics Ltd. Miniature telephoto lens module and a camera utilizing such a lens module
US10015384B2 (en) 2015-04-02 2018-07-03 Corephotonics Ltd. Dual voice coil motor structure in a dual-optical module camera
KR102088603B1 (ko) 2015-04-16 2020-03-13 코어포토닉스 리미티드 소형 접이식 카메라의 오토 포커스 및 광학 이미지 안정화
KR102007379B1 (ko) 2015-05-28 2019-08-05 코어포토닉스 리미티드 이중-조리개 디지털 카메라의 광학식 손떨림 방지 및 자동-초점을 위한 양-방향성 강성
KR102214287B1 (ko) 2015-08-13 2021-02-09 코어포토닉스 리미티드 비디오 지원 및 스위칭/비스위칭 동적 제어 기능이 있는 듀얼-애퍼처 줌 카메라
CN109901342B (zh) 2015-09-06 2021-06-22 核心光电有限公司 紧凑型折叠式相机中带有滚动补偿的自动对焦和光学图像稳定
CN109946832B (zh) 2015-12-29 2021-01-19 核心光电有限公司 具有自动可调节长焦视场的双孔径变焦数字摄影机
EP3758356B1 (en) 2016-05-30 2021-10-20 Corephotonics Ltd. Actuator
EP3381181B1 (en) 2016-06-19 2022-04-06 Corephotonics Ltd. Frame synchronization in a dual-aperture camera system
US10845565B2 (en) 2016-07-07 2020-11-24 Corephotonics Ltd. Linear ball guided voice coil motor for folded optic
WO2018007951A1 (en) 2016-07-07 2018-01-11 Corephotonics Ltd. Dual-camera system with improved video smooth transition by image blending
WO2018045551A1 (en) * 2016-09-09 2018-03-15 Intel Corporation Training and deploying pose regressions in neural networks in autonomous machines
EP3563193B1 (en) 2016-12-28 2021-03-31 Corephotonics Ltd. Folded camera structure with an extended light-folding-element scanning range
KR102164655B1 (ko) 2017-01-12 2020-10-13 코어포토닉스 리미티드 컴팩트 폴디드 카메라
KR102212611B1 (ko) 2017-02-23 2021-02-05 코어포토닉스 리미티드 폴디드 카메라 렌즈 설계
AU2017401161B2 (en) * 2017-03-03 2020-12-10 Huawei Technologies Co., Ltd. Image display method and electronic device
CN110582724B (zh) 2017-03-15 2022-01-04 核心光电有限公司 具有全景扫描范围的照相装置
WO2019048904A1 (en) 2017-09-06 2019-03-14 Corephotonics Ltd. STEREOSCOPIC DEPTH CARTOGRAPHY AND COMBINED PHASE DETECTION IN A DOUBLE-OPENING CAMERA
US10951834B2 (en) 2017-10-03 2021-03-16 Corephotonics Ltd. Synthetically enlarged camera aperture
EP3486606A1 (de) * 2017-11-20 2019-05-22 Leica Geosystems AG Stereokamera und stereophotogrammetrisches verfahren
CN113219614B (zh) 2017-11-23 2023-02-03 核心光电有限公司 摄影机及制法、移动电子设备及减小凸起占用空间的方法
CN114609746A (zh) 2018-02-05 2022-06-10 核心光电有限公司 折叠摄像装置
CN113568251B (zh) 2018-02-12 2022-08-30 核心光电有限公司 数字摄像机及用于提供聚焦及补偿摄像机倾斜的方法
US10694168B2 (en) 2018-04-22 2020-06-23 Corephotonics Ltd. System and method for mitigating or preventing eye damage from structured light IR/NIR projector systems
CN112367448B (zh) 2018-04-23 2022-04-19 核心光电有限公司 感测机构
US11363180B2 (en) 2018-08-04 2022-06-14 Corephotonics Ltd. Switchable continuous display information system above camera
US11635596B2 (en) 2018-08-22 2023-04-25 Corephotonics Ltd. Two-state zoom folded camera
CN116567380A (zh) * 2018-10-08 2023-08-08 Lg伊诺特有限公司 相机模块
CN111919057B (zh) 2019-01-07 2021-08-31 核心光电有限公司 具有滑动接头的旋转机构
EP3782363B1 (en) 2019-03-09 2023-06-07 Corephotonics Ltd. Method for dynamic stereoscopic calibration
KR102640227B1 (ko) 2019-07-31 2024-02-22 코어포토닉스 리미티드 카메라 패닝 또는 모션에서 배경 블러링을 생성하는 시스템 및 방법
CN112399068B (zh) * 2019-08-16 2022-05-03 触景无限科技(北京)有限公司 一种图像处理系统和图像处理方法
US11659135B2 (en) 2019-10-30 2023-05-23 Corephotonics Ltd. Slow or fast motion video using depth information
WO2021116851A2 (en) 2019-12-09 2021-06-17 Corephotonics Ltd. Systems and methods for obtaining a smart panoramic image
US11949976B2 (en) 2019-12-09 2024-04-02 Corephotonics Ltd. Systems and methods for obtaining a smart panoramic image
EP4052176A4 (en) 2020-02-22 2023-01-04 Corephotonics Ltd. SPLIT SCREEN FUNCTION FOR MACRO PHOTOGRAPHY
CN114144898B (zh) 2020-04-26 2022-11-04 核心光电有限公司 用于霍尔棒传感器校正的温度控制
WO2021234515A1 (en) 2020-05-17 2021-11-25 Corephotonics Ltd. Image stitching in the presence of a full field of view reference image
CN117572549A (zh) 2020-05-30 2024-02-20 核心光电有限公司 用于获得超微距图像的系统和方法
US11637977B2 (en) 2020-07-15 2023-04-25 Corephotonics Ltd. Image sensors and sensing methods to obtain time-of-flight and phase detection information
KR102672536B1 (ko) 2020-07-15 2024-06-04 코어포토닉스 리미티드 스캐닝 폴디드 카메라에서의 시점 수차-보정
CN114270145B (zh) 2020-07-31 2024-05-17 核心光电有限公司 用于大行程线性位置感测的霍尔传感器-磁体几何结构
CN116679419A (zh) 2020-08-12 2023-09-01 核心光电有限公司 用于光学防抖的装置和方法
KR20240025049A (ko) 2021-06-08 2024-02-26 코어포토닉스 리미티드 슈퍼-매크로 이미지의 초점면을 틸팅하기 위한 시스템 및 카메라

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630406A (zh) * 2008-07-14 2010-01-20 深圳华为通信技术有限公司 摄像机的标定方法及摄像机标定装置
CN101826206A (zh) * 2010-03-31 2010-09-08 北京交通大学 一种相机自定标的方法
CN102567989A (zh) * 2011-11-30 2012-07-11 重庆大学 基于双目立体视觉的空间定位方法
CN103247053A (zh) * 2013-05-16 2013-08-14 大连理工大学 基于双目显微立体视觉的零件精确定位方法
US8755624B2 (en) * 2011-12-15 2014-06-17 Electronics & Telecommunications Research Institute Image registration device and method thereof

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6980690B1 (en) * 2000-01-20 2005-12-27 Canon Kabushiki Kaisha Image processing apparatus
JP4501239B2 (ja) * 2000-07-13 2010-07-14 ソニー株式会社 カメラ・キャリブレーション装置及び方法、並びに、記憶媒体
JP5362189B2 (ja) * 2006-05-10 2013-12-11 株式会社トプコン 画像処理装置及びその処理方法
CN100583151C (zh) * 2006-09-22 2010-01-20 东南大学 三维扫描系统中双摄像机标定方法
CN100573586C (zh) * 2008-02-21 2009-12-23 南京航空航天大学 一种双目立体测量系统的标定方法
IL193906A (en) * 2008-09-04 2012-06-28 Pro Track Ltd Methods and systems for creating an aligned bank of images with an iterative self-correction technique for coordinate acquisition and object detection
CN102510900B (zh) * 2009-07-01 2015-05-13 天野酶株式会社 麦芽三糖基转移酶及其制备方法和用途
US9380292B2 (en) * 2009-07-31 2016-06-28 3Dmedia Corporation Methods, systems, and computer-readable storage media for generating three-dimensional (3D) images of a scene
US8564641B1 (en) * 2010-06-11 2013-10-22 Lucasfilm Entertainment Company Ltd. Adjusting stereo images
US20120250984A1 (en) * 2010-12-01 2012-10-04 The Trustees Of The University Of Pennsylvania Image segmentation for distributed target tracking and scene analysis
CN104169965B (zh) * 2012-04-02 2018-07-03 英特尔公司 用于多拍摄装置系统中图像变形参数的运行时调整的系统、方法和计算机程序产品
US20140037189A1 (en) 2012-08-02 2014-02-06 Qualcomm Incorporated Fast 3-D point cloud generation on mobile devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630406A (zh) * 2008-07-14 2010-01-20 深圳华为通信技术有限公司 摄像机的标定方法及摄像机标定装置
CN101826206A (zh) * 2010-03-31 2010-09-08 北京交通大学 一种相机自定标的方法
CN102567989A (zh) * 2011-11-30 2012-07-11 重庆大学 基于双目立体视觉的空间定位方法
US8755624B2 (en) * 2011-12-15 2014-06-17 Electronics & Telecommunications Research Institute Image registration device and method thereof
CN103247053A (zh) * 2013-05-16 2013-08-14 大连理工大学 基于双目显微立体视觉的零件精确定位方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875451A (zh) * 2017-02-27 2017-06-20 安徽华米信息科技有限公司 相机标定方法、装置及电子设备
WO2018153374A1 (zh) * 2017-02-27 2018-08-30 安徽华米信息科技有限公司 相机标定
CN106875451B (zh) * 2017-02-27 2020-09-08 安徽华米智能科技有限公司 相机标定方法、装置及电子设备

Also Published As

Publication number Publication date
EP3252715A4 (en) 2018-04-04
EP3252715A1 (en) 2017-12-06
US20180150973A1 (en) 2018-05-31
EP3252715B1 (en) 2020-12-23
CN106709899B (zh) 2020-06-02
CN106709899A (zh) 2017-05-24
US10559090B2 (en) 2020-02-11

Similar Documents

Publication Publication Date Title
WO2017008516A1 (zh) 双摄像头相对位置计算方法、装置和设备
WO2020206903A1 (zh) 影像匹配方法、装置及计算机可读存储介质
CN111457886B (zh) 距离确定方法、装置及系统
WO2018209968A1 (zh) 摄像机标定方法及系统
CN109076200B (zh) 全景立体视频系统的校准方法和装置
US8447140B1 (en) Method and apparatus for estimating rotation, focal lengths and radial distortion in panoramic image stitching
CN112767542A (zh) 一种多目相机的三维重建方法、vr相机和全景相机
KR102367361B1 (ko) 위치 측정 및 동시 지도화 방법 및 장치
WO2018068719A1 (zh) 一种图像拼接方法及装置
US20150124059A1 (en) Multi-frame image calibrator
CN111127524A (zh) 一种轨迹跟踪与三维重建方法、系统及装置
CN107507277B (zh) 三维点云重构方法和装置、服务器及可读存储介质
Saurer et al. Homography based visual odometry with known vertical direction and weak manhattan world assumption
WO2019104571A1 (zh) 图像处理方法和设备
WO2023046211A1 (zh) 摄影测量方法、装置、设备及存储介质
WO2023005457A1 (zh) 位姿计算方法和装置、电子设备、可读存储介质
TWI669683B (zh) 三維影像重建方法、裝置及其非暫態電腦可讀取儲存媒體
CN111882655A (zh) 三维重建的方法、装置、系统、计算机设备和存储介质
CN107820041B (zh) 隐私遮挡方法及装置
Liu et al. Camera self-calibration with lens distortion from a single image
JP2008224323A (ja) ステレオ写真計測装置、ステレオ写真計測方法及びステレオ写真計測用プログラム
TWI502271B (zh) 控制方法及電子裝置
JP6843552B2 (ja) 画像処理装置、画像処理方法およびプログラム。
CN115829833B (zh) 一种图像生成方法及移动设备
JP7493793B2 (ja) 画像標定方法、画像標定装置、画像標定システム及び画像標定プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16823664

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2016823664

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 15572375

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE