WO2018068678A1 - 一种立体摄像机外部参数的确定方法及装置 - Google Patents

一种立体摄像机外部参数的确定方法及装置 Download PDF

Info

Publication number
WO2018068678A1
WO2018068678A1 PCT/CN2017/105061 CN2017105061W WO2018068678A1 WO 2018068678 A1 WO2018068678 A1 WO 2018068678A1 CN 2017105061 W CN2017105061 W CN 2017105061W WO 2018068678 A1 WO2018068678 A1 WO 2018068678A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinate system
camera
plane equation
axis
stereo camera
Prior art date
Application number
PCT/CN2017/105061
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 EP17860823.8A priority Critical patent/EP3528209A1/en
Priority to US16/340,901 priority patent/US11010924B2/en
Publication of WO2018068678A1 publication Critical patent/WO2018068678A1/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
    • 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
    • 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
    • H04N13/246Calibration of cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/04Indexing scheme for image data processing or generation, in general involving 3D image data
    • 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/10004Still image; Photographic image
    • G06T2207/10012Stereo images
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • 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 application relates to the field of image processing, and in particular, to a method and apparatus for determining external parameters of a stereo camera.
  • stereo cameras can be used to acquire stereoscopic images.
  • the stereo camera needs to be calibrated in advance to determine accurate camera parameters.
  • the camera parameters include internal parameters of the camera, commonly referred to as internal parameters, and external parameters, commonly referred to as external parameters.
  • the external parameter indicates the position and direction of the stereo camera in the world coordinate system, that is, the stereo camera external parameter represents the coordinate transformation relationship between the camera coordinate system and the world coordinate system, and the stereo camera external parameter acquires the image to the camera.
  • the accuracy of the stereo camera has a great influence.
  • FIG. 1 is a schematic diagram of external parameters of a stereo camera.
  • the stereo camera is The origin in the camera coordinate system is identified as 0 c, ; the coordinate system represented by the dashed line on the surface plane is the world coordinate system, the origin is 0; the camera coordinate system is translated to the surface In the plane, the origin 0 c of the camera coordinate system coincides with the origin 0 of the world coordinate system; wherein the distance H between the surface and the origin of the camera coordinate system is the height of the stereo camera; the P angle is the elevation angle of the stereo camera.
  • the I angle is the tilt angle of the stereo camera.
  • methods for determining external parameters of a stereo camera generally include:
  • the external parameters of the stereo camera need to be adjusted, and the above evaluation process is iterated until a stereo camera external reference meeting the evaluation criteria is obtained.
  • the method for determining the external reference of the stereo camera of the related art requires the reference point of the vertical edge perpendicular to the ground in the scene to obtain an accurate external reference of the stereo camera, and the requirement for the application scenario is high.
  • the purpose of the embodiments of the present application is to provide a method and a device for determining external parameters of a stereo camera, and the external parameters of the stereo camera can be determined without using a reference point in the scene.
  • the specific technical solutions are as follows:
  • An embodiment of the present application discloses a method for determining an external parameter of a stereo camera, the method comprising: acquiring surface data of a position where the stereo camera is located; and corresponding to each stereo pixel in the surface data according to the surface data. Corresponding three-dimensional coordinates in the camera coordinate system, generating a first plane equation corresponding to the three-dimensional coordinates corresponding to the pixel points in the camera coordinate system; according to the distance between the origin and the surface in the camera coordinate system Determining a erection height of the stereo camera; generating a plane normal vector corresponding to the first plane equation according to the first plane equation; determining a pitch angle of the stereo camera and the stereo according to the plane normal vector The tilt angle of the camera.
  • the method further includes: performing filtering processing on the surface data when the surface data does not meet a preset condition; wherein the filtering processing comprises time domain value filtering and spatial domain value filtering.
  • the generating according to the corresponding three-dimensional coordinates of each pixel point in the surface data in the camera coordinate system corresponding to the stereo camera, generating a three-dimensional coordinate corresponding to each pixel point in the camera coordinate system a step of a plane equation, comprising: selecting at least three pixel points from pixels of the surface data, and using the corresponding three-dimensional coordinates of the at least three pixel points in a camera coordinate system corresponding to the stereo camera as a first a sample set; according to the first sample set, Generating a second plane equation corresponding to the corresponding three-dimensional coordinates of each pixel in the first sample set in the camera coordinate system; determining all of the pixels in the surface data according to the second plane equation Corresponding to the pixel points of the second plane equation, and using the corresponding three-dimensional coordinates of the pixel points in the camera coordinate system as the second sample set according to the second plane equation; according to the second sample set, A first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of
  • the step of selecting at least three pixel points from the pixel points of the surface data comprises: selecting at least three pixel points from pixels of the surface data by using a random consistency sampling RANSAC algorithm.
  • the at least three pixel points are selected from the pixel points of the surface data, and the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera are used as the first sample set.
  • generating, according to the first sample set, a second plane equation that conforms to the three-dimensional coordinates corresponding to each pixel point in the first sample set comprising: using a RANSAC algorithm, from a pixel of the surface data Selecting at least three pixel points from the points, and corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera as the first sample set; generating a match according to the first sample set a current plane equation of the corresponding three-dimensional coordinates of each pixel in the first sample set in the camera coordinate system; determining whether the current plane equation satisfies a preset condition; when the current plane equation satisfies a preset condition Determining that the current plane equation is a second plane equation; when the current plane
  • the preset condition includes: the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset Second threshold.
  • the step of generating, according to the second sample set, a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system in the camera coordinate system comprising: Performing a fitting process on the second sample set using a least squares method to generate a first flat corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system Surface equation.
  • the step of determining a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector includes: determining, in the camera coordinate system, a standard posture in the stereo camera Rotating to a current posture, corresponding to a first angle of the z c axis rotating in a clockwise direction around the x axis, and using the first angle as a pitch angle of the stereo camera; and in the camera coordinate system, determining a second angle at which the stereo camera rotates to the z-axis in a clockwise direction corresponding to the x c- axis when the stereoscopic camera is rotated to the current posture, and the second angle is used as a tilt angle of the stereo camera; a three-dimensional coordinate system composed of the x c axis, the z c axis, and the y c axis is the camera coordinate system; a three-dimensional coordinate system composed of the x axis, the z axis, and the y axis is is the camera coordinate
  • the embodiment of the present application further discloses a device for determining an external parameter of a stereo camera, the device comprising: an acquiring unit, configured to acquire surface data of a location where the stereo camera is located; and a first generating unit, configured to be used according to the surface data a first plane equation corresponding to the three-dimensional coordinates corresponding to the pixel points is generated in the camera coordinate system, corresponding to the corresponding three-dimensional coordinates in the camera coordinate system corresponding to the stereo camera; the first determining unit is configured to: Determining an erection height of the stereo camera according to a distance between the origin in the camera coordinate system and the ground surface; and generating, by the second generating unit, the first plane equation corresponding to the first plane equation a plane normal vector; a second determining unit, configured to determine a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector.
  • the device further includes: a filtering unit, configured to perform filtering processing on the surface data when the surface data does not meet a preset condition; wherein the filtering process includes time domain value filtering and spatial domain Value filtering.
  • a filtering unit configured to perform filtering processing on the surface data when the surface data does not meet a preset condition; wherein the filtering process includes time domain value filtering and spatial domain Value filtering.
  • the first generating unit includes: a first selecting subunit, a first generating subunit, a first determining subunit, and a second generating subunit; the first selecting subunit, for using the ground surface Selecting at least three pixel points from the pixels of the data, and using the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera as the first sample set; the first generating sub-unit, And generating, according to the first sample set, a second plane equation corresponding to the corresponding three-dimensional coordinates of each pixel point in the first sample set in the camera coordinate system; the first determining Subunits for determining, in accordance with the second plane equation shown, all pixel points that conform to the second plane equation among the pixels in the surface data, and the pixel points that conform to the second plane equation Corresponding three-dimensional coordinates in the camera coordinate system as a second sample set; the second generating sub-unit, configured to generate pixels in the camera coordinate system that conform to the surface data according to the second sample
  • the first selecting subunit is specifically configured to select at least three pixel points from pixels of the surface data by using a random consistency sampling RANSAC algorithm.
  • the first generating subunit includes: a second selecting subunit, a third generating subunit, a determining subunit, a second determining subunit, and a return executing subunit; and the second selecting subunit, Using the RANSAC algorithm, selecting at least three pixel points from the pixel points of the surface data, and using the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera as the first sample set;
  • the third generating subunit is configured to generate, according to the first sample set, a current plane equation that conforms to corresponding three-dimensional coordinates of each pixel point in the first sample set in the camera coordinate system; a determining subunit, configured to determine whether the current plane equation satisfies a preset condition; and the second determining subunit is configured to determine that the current plane equation is a second plane when the current plane equation satisfies a preset condition
  • the return execution subunit configured to increment the number of iterations by 1 when the current plane equation does not satisfy
  • the preset condition includes: the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset Second threshold.
  • the second generating subunit is specifically configured to perform a fitting process on the second sample set by using a least square method to generate a first plane equation corresponding to the three-dimensional coordinates corresponding to the pixel points of the surface data.
  • the second determining unit includes: a third determining subunit and a fourth determining subunit; the third determining subunit, configured to determine, in the camera coordinate system, that the stereo camera is standard a first angle in which the z c axis rotates in the clockwise direction about the x axis when the posture is rotated to the current posture, and the first angle is used as a pitch angle of the stereo camera; and the fourth determining subunit is used for Determining, in the camera coordinate system, a second angle corresponding to the x c axis rotating in the clockwise direction about the z axis when the stereo camera is rotated from the standard posture to the current posture, and the second angle is a tilt angle of the stereo camera; wherein a three-dimensional coordinate system composed of the x c axis, the z c axis, and the y c axis is the camera coordinate system; the x axis, the z axis, and The three-dimensional coordinate system composed of the y-axis, the
  • the method and device for determining the external parameters of the stereo camera provided by the embodiment of the present application can determine the first plane equation in the camera coordinate system according to the three-dimensional coordinates of each pixel point in the camera coordinate system according to the surface data, so that the first The plane equation is applicable to each pixel in the surface data; the erection height of the stereo camera is determined according to the distance between the origin and the surface in the camera coordinate system; finally, the plane normal vector is generated according to the first plane equation, and the stereo is determined according to the plane normal vector The pitch angle of the camera and the tilt angle of the stereo camera.
  • the reference point in the scene is not required, and the external parameters of the stereo camera can be determined only by the acquired surface data, which is suitable for most application scenarios, and avoids the acquisition of external parameters due to the application scenario not meeting the requirements.
  • the accuracy of the external reference of the stereo camera is ensured, thereby ensuring the stereoscopic image acquired by the stereo camera.
  • 1 is a schematic diagram of external parameters of a stereo camera
  • FIG. 2 is a flowchart of a method for determining an external parameter of a stereo camera in the embodiment of the present application
  • FIG. 3 is still another flowchart of determining a method for determining external parameters of a stereo camera in the embodiment of the present application
  • FIG. 4 is another flow chart of a method for determining external parameters of a stereo camera in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of determining an external reference of a stereo camera in the embodiment of the present application.
  • FIG. 6 is a structural diagram of an apparatus for determining external parameters of a stereo camera in an embodiment of the present application
  • FIG. 7 is still another structural diagram of an apparatus for determining external parameters of a stereo camera in the embodiment of the present application.
  • FIG. 2 is a flowchart of a method for determining an external parameter of a stereo camera according to an embodiment of the present application, including the following steps:
  • Step 201 Obtain surface data of a location where the stereo camera is located
  • the stereo camera external parameter determined according to the surface data of the position of the stereo camera can only be applied to the stereo camera to shoot at the current position.
  • the current stereo camera is located on the hillside and is determined according to the surface data of the hillside.
  • the external reference is only suitable for the shooting of the stereo camera on the hillside, but the external reference determined according to the surface data of the hillside cannot be used for the shooting of the stereo camera on the plain, otherwise it will affect the shooting effect of the stereo camera.
  • a binocular camera can be used to generate a two-dimensional image of the surface and a parallax map of the surface
  • a time-of-flight (TOF) depth camera can be used to generate a two-dimensional image of the surface and a depth map of the surface.
  • TOF time-of-flight
  • the surface data may include a two-dimensional image of the surface and a disparity map, and the binocular camera may map the two-dimensional image of the surface in the image coordinates according to the disparity map of the surface.
  • the two-dimensional coordinates are converted into three-dimensional coordinates in the camera coordinate system corresponding to the binocular camera; wherein the camera coordinate system here is a three-dimensional coordinate system with the binocular camera as the origin.
  • the surface data can include a two-dimensional image and a depth map of the surface, and the TOF depth camera can convert the two-dimensional coordinates of the two-dimensional image of the surface in the image coordinates to the TOF depth camera according to the depth map of the surface.
  • the method may further include:
  • the surface data When the surface data does not meet the preset condition, the surface data is subjected to filtering processing; wherein the filtering processing includes time domain value filtering and spatial domain value filtering.
  • the time domain value filtering means that, for a certain pixel in the image to be processed, the mean value of the pixel at the same position in the consecutive multiple frames of the image to be processed may be replaced by the average of the pixels in the image to be processed. At a certain pixel, all the pixels in the image to be processed are subjected to the same replacement process.
  • the spatial domain value filtering means that for a certain pixel in the image to be processed, the average of the 3 ⁇ 3 pixel matrix around the certain pixel point in the image to be processed may be used to replace the certain pixel point, and the processing is to be processed. All pixels in the image do the same replacement.
  • the frame image when a certain frame image is out of alignment due to a parallax calculation error, the frame image may be filtered by using time domain value filtering to improve the imaging quality of the image of the certain frame; In the case where the image quality of the image is poor due to the inability to perform the parallax calculation on the special position in the feature scene, the image may be filtered using spatial domain value filtering to improve the image quality of the image.
  • the filtering process on the surface data is not necessary. If the quality of the surface data conforms to the preset condition, the filtering process can be omitted.
  • the local table data includes the disparity map
  • it is necessary to determine whether the disparity map is valid that is, whether the corresponding disparity value of each pixel in the disparity map in the plane image is within a reasonable range; for example, in a certain scene, the photograph is taken.
  • the range of the closest distance and the farthest distance of the image is known, and the disparity values corresponding to the nearest distance and the farthest distance are also known.
  • the one of the disparity maps is considered to be invalid, and the pixels in the plane image corresponding to the certain disparity may be ignored, and the remaining pixels in the plane image are used.
  • a large number of pixels are used for subsequent calculations.
  • the local table data includes the depth map
  • it is necessary to determine whether the depth map is valid that is, whether the depth value corresponding to each pixel point in the depth map in the plane image is within a reasonable range; the specific judgment method and the judgment of the disparity value are valid.
  • the method is similar, and it is also determined whether each depth value in the depth map is within the valid range. If a certain depth value exceeds the valid range, the certain depth value is invalid, and the certain depth may be ignored.
  • the pixel points in the plane image corresponding to the value are used for subsequent calculation using a large number of pixel points remaining in the plane image.
  • Step 202 Generate, according to corresponding three-dimensional coordinates of each pixel point in the camera data in the camera coordinate system corresponding to the stereo camera, a first plane that matches the three-dimensional coordinates corresponding to the pixel points in the camera coordinate system. equation;
  • the plane equation to be determined may be preset, and the plurality of unknown parameters are included; then, the unknown parameters in the plane equation to be determined are determined according to the corresponding three-dimensional coordinates of each pixel in the camera coordinate system;
  • the plane equation to be determined for each parameter value is known as the first plane equation.
  • the first plane equation can fit the distribution law of pixel points in the surface data to the greatest extent, and ensure the accuracy of the obtained external parameters of the stereo camera.
  • Step 203 Determine a erection height of the stereo camera according to a distance between an origin in the camera coordinate system and the surface.
  • the origin in the camera coordinate system corresponding to the stereo camera is a stereo camera
  • the distance between the origin and the surface in the camera coordinate system can be calculated, and the distance is determined as the erection height of the stereo camera;
  • the stereo camera is erected for three stereo shots. Like one of the external parameters.
  • Step 204 Determine, according to the first plane equation, a plane normal vector corresponding to the first plane equation
  • This step can be the same as the related art, and the plane normal vector corresponding to the first plane equation can be calculated according to the first plane equation obtained in step 203 to calculate the pitch angle and the tilt angle of the stereo camera.
  • Step 205 Determine a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector.
  • step 205 may specifically include:
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis is the camera coordinate system;
  • the three-dimensional coordinate system composed of the x axis, the z axis and the y axis is the world a coordinate system; when the x c axis and the z c axis coincide with directions of the x axis and the z axis, and the y c axis is opposite to the direction of the y axis, corresponding to the stereo camera
  • the posture is the standard posture.
  • the first plane equation can be determined by using the surface data and according to the three-dimensional coordinates of each pixel point in the camera coordinate system in the surface data, wherein the first plane equation can reflect all the data in the surface data.
  • the distribution law of the pixel points next, the distance between the origin and the surface in the camera coordinate system is determined to determine the erection height of the stereo camera, and a plane normal vector of the first plane equation is generated; and the tilt of the stereo camera is determined according to the plane normal vector The angle and the tilt angle of the stereo camera.
  • the external parameters of the stereo camera can be determined without using the reference point in the scene, which is not only applicable to most application scenarios, but also avoids the acquisition of the external parameters due to the application scenario not meeting the requirements.
  • the accuracy of the external reference of the stereo camera is ensured.
  • FIG. 3 is still another flowchart of a method for determining external parameters of a stereo camera according to an embodiment of the present application, including the following steps:
  • Step 301 Obtain surface data of a location where the stereo camera is located.
  • Step 302 Select at least three pixel points from the pixel points of the surface data, and use the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera as the first sample set; Generating, by the first set of samples, a second plane equation that conforms to corresponding three-dimensional coordinates of each pixel point in the first sample set in the camera coordinate system;
  • the second plane equation can be preset as shown in the formula (1):
  • FIG. 4 is another flowchart of a method for determining an external parameter of a stereo camera in the embodiment of the present application, where the step 303 may specifically include the following sub-steps. :
  • Sub-step 11 using a RANdom SAmple Consensus (RANSAC) algorithm, selecting at least three pixel points from pixels of the surface data, and placing the at least three pixels in the camera corresponding to the stereo camera Corresponding three-dimensional coordinates in the coordinate system as a first sample set;
  • RANSAC RANdom SAmple Consensus
  • Sub-step 12 generating, according to the first sample set, a current plane equation that conforms to corresponding three-dimensional coordinates of each pixel point in the first sample set in the camera coordinate system;
  • Sub-step 13 determining whether the current plane equation satisfies a preset condition
  • Sub-step 14 determining the current plane when the current plane equation satisfies a preset condition Cheng is the second plane equation
  • Sub-step 15 when the current plane equation does not satisfy the preset condition, the number of iterations is incremented by 1, and the sub-step 11 is returned.
  • the initial value of the number of iterations is 0.
  • the preset condition may specifically include:
  • the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset second threshold.
  • the first threshold may be a specific number of pixels of the surface data that conform to the current plane equation, or may be the total number of pixels of the surface data that conform to the current plane equation and occupy the total pixel of the surface data.
  • the percentage of the number; the first threshold and the second threshold may be set according to actual conditions; the specific expression of the first threshold is not limited in the present application.
  • Step 303 Determine, according to the second plane equation, all pixel points that meet the second plane equation in the pixel points in the surface data, and set the pixel points that meet the second plane equation in the Corresponding three-dimensional coordinates in the camera coordinate system as a second sample set;
  • all pixels corresponding to the second plane equation are selected from the pixels in the surface data, and the three-dimensional corresponding to the pixel points are selected.
  • the coordinates are used as a second sample set.
  • Step 304 Generate, according to the second sample set, a first plane equation in the camera coordinate system that corresponds to a corresponding three-dimensional coordinate of a pixel point of the surface data in the camera coordinate system;
  • the step 305 may specifically be:
  • the second sample set is subjected to a fitting process using a least squares method to generate a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system.
  • the first step it is known that there are n pixel points in the second sample set, and the corresponding three-dimensional coordinates are (x 1 , y 1 , z 1 ), (x 2 , y 2 , z 2 ), ..., (x n , y n , z n ).
  • the first plane equation can be preset as shown in equation (2):
  • matrix A is an N ⁇ 3 matrix composed of all three-dimensional points
  • matrix X is with A 1 ⁇ 3 matrix composed of a matrix B of [-1; -1; -1].
  • Equation (6) X is the least squares solution of equation (5); matrix A T is the transposed matrix of matrix A, and matrix (A T A) -1 is the inverse matrix of matrix A T A (A T A) -1 A T is the value obtained by pseudo-inverting the matrix A.
  • the third step the matrix X solved by equation (6) is with a 1 ⁇ 3 matrix composed, therefore, the matrix X can be used to determine the modified first plane equation in equation (3) with Then calculate a, b, c and d in the first plane equation in formula (2), and finally obtain the specific form of the first plane equation.
  • Step 305 Determine a erection height of the stereo camera according to a distance between an origin in the camera coordinate system and the surface.
  • Step 306 Generate a plane normal vector corresponding to the first plane equation according to the first plane equation
  • Step 307 in the camera coordinate system, determining a first angle that rotates in the clockwise direction about the x-axis corresponding to the z c- axis when the stereo camera rotates from the standard posture to the current posture, and uses the first angle as a pitch angle of the stereo camera;
  • Step 308 in the camera coordinate system, determining a second angle corresponding to the x c axis rotating in the clockwise direction about the z axis when the stereo camera is rotated from the standard posture to the current posture, and the The second angle serves as the tilt angle of the stereo camera.
  • FIG. 5 is a schematic diagram of determining an external reference of a stereo camera.
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis in the upper part of the figure is a camera coordinate system corresponding to the stereo camera, and the stereo camera is the origin of the camera coordinate system, and the identifier is 0 c ;
  • the three-dimensional coordinate system composed of the x-axis, the z-axis, and the y-axis, which is indicated by a broken line on the surface plane, is a world coordinate system, and the origin is 0.
  • Planar normal vector There may be two directions, namely the direction identified in Figure 5, or the direction opposite to the direction identified in Figure 5.
  • the height H is the erection height of the stereo camera
  • the angle P is the elevation angle of the stereo camera
  • the angle I is the tilt angle of the stereo camera; specifically, the elevation angle P is when the stereo camera is rotated from the standard posture to FIG. 5
  • the angle of the z c axis needs to be rotated in the clockwise direction around the x axis.
  • the x c is required. in a clockwise direction about the z axis rotation angle of the shaft; wherein the posture standard stereo camera means that when the direction of C-axis and z-x C x axis and z-axes of the world coordinate system of the camera coordinate system is consistent, And when the y c axis in the camera coordinate system is opposite to the direction of the y axis in the world coordinate system, corresponding to the attitude of the stereo camera, it can be understood that when the stereo camera is in the standard posture, the elevation angle P and the tilt angle I are both 0. .
  • the expression of the distance between the origin in the camera coordinate system and the surface is as shown in the formula (7).
  • H is the erection height of the stereo camera
  • a, b, c, and d are the parameters in the first plane equation
  • the second plane equation can be generated through multiple calculation iterations according to the three-dimensional coordinates of each pixel point in the camera coordinate system in the surface data; next, all the pixels in the surface data are determined to be in accordance with the second The pixel points of the plane equation, the least squares calculation of the pixel points, the first plane equation which can represent the distribution law of all the pixel points in the surface data; and then the plane normal vector and the camera coordinate system according to the first plane equation
  • the origin of the stereo camera is determined by the origin.
  • FIG. 6 is a structural diagram of an apparatus for determining an external parameter of a stereo camera according to an embodiment of the present disclosure.
  • the apparatus corresponds to the method flow shown in FIG. 2 , and specifically includes the following units:
  • the acquiring unit 601 is configured to acquire surface data of a location where the stereo camera is located;
  • the first generating unit 602 is configured to generate, according to the corresponding three-dimensional coordinates of each pixel point in the camera data corresponding to the stereo camera, the three-dimensional coordinates corresponding to the pixel points in the camera coordinate system.
  • a first determining unit 603, configured to determine a erection height of the stereo camera according to a distance between an origin in the camera coordinate system and the ground surface;
  • a second generating unit 604 configured to generate the first plane equation according to the first plane equation Corresponding plane normal vector;
  • the second determining unit 605 is configured to determine a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector.
  • the device further includes:
  • a filtering unit configured to perform filtering processing on the surface data when the surface data does not meet a preset condition; wherein the filtering process includes time domain value filtering and spatial domain value filtering.
  • the device embodiment of the present application can determine the first plane equation by using the surface data and according to the three-dimensional coordinates of each pixel point in the camera coordinate system in the surface data, wherein the first plane equation can represent all the pixels in the surface data.
  • the distribution law of the point next, the distance between the origin and the surface in the camera coordinate system is determined to determine the erection height of the stereo camera, and the plane normal vector of the first plane equation is generated; and the elevation angle of the stereo camera is determined according to the plane normal vector And the tilt angle of the stereo camera.
  • the external parameters of the stereo camera can be determined without using the reference point in the scene, which is not only applicable to most application scenarios, but also avoids the acquisition of foreign parameters due to the application scenario not meeting the requirements. , to ensure the accuracy of the stereo camera external parameters.
  • FIG. 7 is another structural diagram of an apparatus for determining external parameters of a stereo camera according to an embodiment of the present disclosure.
  • the apparatus corresponds to the method flow shown in FIG. 3, and the apparatus includes: an acquiring unit 701, and a first generation.
  • the determining unit 603 may be identical, and the second generating unit 704 may be identical to the second generating unit 604 shown in FIG. 6, and details are not described herein again.
  • the first generating unit 702 specifically includes: a first selecting subunit 706, a first generating subunit 707, a first determining subunit 708, and a second generating subunit 709;
  • the first selecting sub-unit 706 is configured to select at least three pixel points from the pixel points of the surface data, and set the at least three pixel points in a camera coordinate system corresponding to the stereo camera The three-dimensional coordinates should be used as the first sample set;
  • the first generating sub-unit 707 is configured to generate, according to the first sample set, a second plane equation that conforms to corresponding three-dimensional coordinates of each pixel point in the first sample set in the camera coordinate system;
  • the first determining subunit 708 is configured to determine, in the pixel points in the surface data, all pixel points that meet the second plane equation according to the second plane equation shown, and match the first The corresponding three-dimensional coordinates of the pixel points of the two plane equation in the camera coordinate system are used as the second sample set;
  • the second generation subunit 709 is configured to generate, according to the second sample set, a first plane corresponding to the corresponding three-dimensional coordinates of the pixel point of the surface data in the camera coordinate system in the camera coordinate system. equation.
  • the first selecting sub-unit 706 is specifically configured to select at least three pixel points from pixels of the surface data by using a RANSAC algorithm.
  • the first generating subunit 707 specifically includes: a second selecting subunit 710, a third generating subunit 711, a determining subunit 712, a second determining subunit 713, and Return to the execution subunit 714;
  • the second selecting sub-unit 710 is configured to select at least three pixel points from the pixel points of the surface data by using a RANSAC algorithm, and the at least three pixel points are in a camera coordinate system corresponding to the stereo camera Corresponding three-dimensional coordinates as a first sample set;
  • the third generation subunit 711 is configured to generate, according to the first sample set, a current plane equation that conforms to corresponding three-dimensional coordinates of each pixel in the first sample set in the camera coordinate system;
  • the determining subunit 712 is configured to determine whether the current plane equation satisfies a preset condition
  • the second determining subunit 713 is configured to determine that the current plane equation is a second plane equation when the current plane equation satisfies a preset condition
  • the return execution sub-unit 714 is configured to: when the current plane equation does not satisfy the preset condition, increase the number of iterations by one, and return to perform execution of the at least three pixels from the surface data. a pixel, the step of using the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system as a first sample set; wherein an initial value of the number of iterations is 0.
  • the preset condition includes:
  • the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset second threshold.
  • the second generating sub-unit 709 is specifically configured to perform a fitting process on the second sample set by using a least square method to generate a pixel point corresponding to the surface data.
  • the second determining unit 705 includes: a third determining subunit 715 and a fourth determining subunit 716;
  • the third determining sub-unit 715 is configured to determine, in the camera coordinate system, a first angle that rotates in a clockwise direction around the x-axis corresponding to the z c- axis when the stereo camera rotates from a standard posture to a current posture, And using the first angle as a pitch angle of the stereo camera;
  • the fourth sub-unit 716 determines, for the camera coordinate system, corresponding to x c-axis is determined when the standard by the stereo camera pose is rotated to the current attitude in the clockwise direction about the z axis of rotation a second angle, and the second angle is used as an inclination angle of the stereo camera;
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis is the camera coordinate system;
  • the three-dimensional coordinate system composed of the x axis, the z axis and the y axis is the world a coordinate system; when the x c axis and the z c axis coincide with directions of the x axis and the z axis, and the y c axis is opposite to the direction of the y axis, corresponding to the stereo camera
  • the posture is the standard posture.
  • the device embodiment of the present application can generate a second plane equation through multiple calculation iterations according to the three-dimensional coordinates of each pixel point in the camera coordinate system in the surface data; next, all the pixels in the surface data are determined to conform to the second plane.
  • the origin determines the external parameters of the stereo camera. In this way, the method of external parameters of the stereo camera determined by the surface data can be applied to most application scenarios, and is not only convenient to use but also ensures that the obtained external parameters are accurate and reliable.
  • the embodiment of the present application further discloses a storage medium for storing executable code, and the executable code is configured to perform the following steps at runtime:
  • the method further includes:
  • the surface data When the surface data does not meet the preset condition, the surface data is subjected to filtering processing; wherein the filtering processing includes time domain value filtering and spatial domain value filtering.
  • the generating according to the corresponding three-dimensional coordinates of each pixel point in the camera data in the camera coordinate system corresponding to the stereo camera, generating three-dimensional coordinates corresponding to the pixel points in the camera coordinate system.
  • the steps of the first plane equation include:
  • the step of selecting at least three pixels from the pixels of the surface data includes:
  • At least three pixel points are selected from the pixels of the surface data using a random consistency sampling RANSAC algorithm.
  • the at least three pixel points are selected from the pixel points of the surface data, and the corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera are used as the first sample.
  • the number of iterations is incremented by 1, and returns to perform at least three pixel points from the pixel points of the surface data, and the at least three pixels are
  • the step of the corresponding three-dimensional coordinates in the camera coordinate system is used as the first sample set; wherein the initial value of the number of iterations is 0.
  • the preset condition includes:
  • the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset second threshold.
  • the step of generating, according to the second sample set, a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system including:
  • the second sample set is subjected to a fitting process using a least squares method to generate a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system.
  • the step of determining a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector includes:
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis is the camera coordinate system;
  • the three-dimensional coordinate system composed of the x axis, the z axis and the y axis is the world a coordinate system; when the x c axis and the z c axis coincide with directions of the x axis and the z axis, and the y c axis is opposite to the direction of the y axis, corresponding to the stereo camera
  • the posture is the standard posture.
  • the storage medium embodiment of the present application can generate a second plane equation after multiple calculations according to the three-dimensional coordinates of each pixel in the camera coordinate system in the surface data; next, all the pixels in the surface data are determined to be in accordance with the second
  • the origin of the stereo camera is determined by the origin. In this way, the method of external parameters of the stereo camera determined by the surface data can be applied to most application scenarios, and is not only convenient to use but also ensures that the obtained external parameters are accurate and reliable.
  • the method further includes:
  • the surface data When the surface data does not meet the preset condition, the surface data is subjected to filtering processing; wherein the filtering processing includes time domain value filtering and spatial domain value filtering.
  • the generating according to the corresponding three-dimensional coordinates of each pixel point in the camera data in the camera coordinate system corresponding to the stereo camera, generating three-dimensional coordinates corresponding to the pixel points in the camera coordinate system.
  • the steps of the first plane equation include:
  • the step of selecting at least three pixels from the pixels of the surface data includes:
  • At least three pixel points are selected from the pixels of the surface data using a random consistency sampling RANSAC algorithm.
  • the at least three pixel points are selected from pixels of the surface data, and the Corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera are used as a first sample set; according to the first sample set, generating corresponding to each pixel point in the first sample set
  • the steps of the second plane equation of the three-dimensional coordinates include:
  • the number of iterations is incremented by 1, and returns to perform at least three pixel points from the pixel points of the surface data, and the at least three pixels are
  • the step of the corresponding three-dimensional coordinates in the camera coordinate system is used as the first sample set; wherein the initial value of the number of iterations is 0.
  • the preset condition includes:
  • the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset second threshold.
  • the step of generating, according to the second sample set, a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system including:
  • the second sample set is subjected to a fitting process using a least squares method to generate a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system.
  • the step of determining a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector includes:
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis is the camera coordinate system;
  • the three-dimensional coordinate system composed of the x axis, the z axis and the y axis is the world a coordinate system; when the x c axis and the z c axis coincide with directions of the x axis and the z axis, and the y c axis is opposite to the direction of the y axis, corresponding to the stereo camera
  • the posture is the standard posture.
  • the application embodiment of the present application can generate a second plane equation after multiple calculations according to the three-dimensional coordinates of each pixel in the camera coordinate system in the surface data; next, all the pixels in the surface data are determined to be in accordance with the second
  • the origin of the stereo camera is determined by the origin.
  • the embodiment of the present application further discloses a device for determining external parameters of a stereo camera, including: a controller, a memory, a communication interface, and a bus;
  • the controller, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory is for storing executable program code
  • the controller is configured to execute a program corresponding to the executable program code by reading executable program code stored in the memory to perform the following steps:
  • the method further includes:
  • the surface data When the surface data does not meet the preset condition, the surface data is subjected to filtering processing; wherein the filtering processing includes time domain value filtering and spatial domain value filtering.
  • the generating according to the corresponding three-dimensional coordinates of each pixel point in the camera data in the camera coordinate system corresponding to the stereo camera, generating three-dimensional coordinates corresponding to the pixel points in the camera coordinate system.
  • the steps of the first plane equation include:
  • the step of selecting at least three pixels from the pixels of the surface data includes:
  • At least three pixel points are selected from the pixels of the surface data using a random consistency sampling RANSAC algorithm.
  • the at least three pixel points are selected from pixels of the surface data, and the Corresponding three-dimensional coordinates of the at least three pixel points in the camera coordinate system corresponding to the stereo camera are used as a first sample set; according to the first sample set, generating corresponding to each pixel point in the first sample set
  • the steps of the second plane equation of the three-dimensional coordinates include:
  • the number of iterations is incremented by 1, and returns to perform at least three pixel points from the pixel points of the surface data, and the at least three pixels are
  • the step of the corresponding three-dimensional coordinates in the camera coordinate system is used as the first sample set; wherein the initial value of the number of iterations is 0.
  • the preset condition includes:
  • the number of pixels in the pixel of the surface data that meets the current plane equation reaches a preset first threshold, or the number of iterations corresponding to the current plane equation reaches a preset second threshold.
  • the step of generating, according to the second sample set, a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system including:
  • the second sample set is subjected to a fitting process using a least squares method to generate a first plane equation corresponding to the corresponding three-dimensional coordinates of the pixel points of the surface data in the camera coordinate system.
  • the step of determining a pitch angle of the stereo camera and a tilt angle of the stereo camera according to the plane normal vector includes:
  • the three-dimensional coordinate system composed of the x c axis, the z c axis and the y c axis is the camera coordinate system;
  • the three-dimensional coordinate system composed of the x axis, the z axis and the y axis is the world a coordinate system; when the x c axis and the z c axis coincide with directions of the x axis and the z axis, and the y c axis is opposite to the direction of the y axis, corresponding to the stereo camera
  • the posture is the standard posture.
  • the apparatus for determining the external parameters of the stereo camera of the present application can generate the second plane equation after multiple calculations according to the three-dimensional coordinates of each pixel in the camera coordinate system in the surface data; next, determine the pixel points of the surface data. All the pixels in the second plane equation are subjected to least squares calculation to obtain a first plane equation which can reflect the distribution law of all the pixels in the surface data; and then the plane method according to the first plane equation The vector and the origin of the camera coordinate system determine the external parameters of the stereo camera. In this way, the method of external parameters of the stereo camera determined by the surface data can be applied to most application scenarios, and is not only convenient to use but also ensures that the obtained external parameters are accurate and reliable.

Landscapes

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

Abstract

本申请实施例提供了一种立体摄像机外部参数的确定方法及装置,方法包括:获取立体摄像机所处位置的地表数据;根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。应用本申请实施例不需要借助场景中的参考点就能够确定立体摄像机的外部参数。

Description

一种立体摄像机外部参数的确定方法及装置
本申请要求于2016年10月12日提交中国专利局、申请号为201610889992.7发明名称为“一种立体摄像机外部参数的确定方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理领域,特别是涉及一种立体摄像机外部参数的确定方法及装置。
背景技术
随着图像处理的技术的飞速发展,基于立体视觉图像的人体检测、目标跟踪、物体检测、距离检测、物体扫描识别以及场景三维重建等应用也得到了快速发展。
通常情况下,可以使用立体摄像机来获取立体视觉图像。在使用立体摄像机获取立体视觉图像之前,需要预先对立体摄像机进行标定以确定准确的摄像机参数。具体地,摄像机参数包括摄像机的内部参数,通常简称内参,以及外部参数,通常简称外参。其中,外参表示立体摄像机在世界坐标系中的位置和方向,也就是说,立体摄像机外参表征了摄像机坐标系与世界坐标系之间的坐标变换关系,而立体摄像机外参对摄像机获取图像的精度有很大影响,通常将立体摄像机的架设高度、立体摄像机的俯仰角以及立体摄像机的倾斜角这三个参数作为立体摄像机的外参。如图1所示,图1为立体摄像机外部参数的示意图,在图1上部由xc轴、zc轴和yc轴组合成的三维坐标系为立体摄像机对应的摄像机坐标系,立体摄像机即为摄像机坐标系中的原点,标识为0c,;地表平面上虚线标识的由x轴、z轴和y轴组合成的坐标系为世界坐标系,原点为0;将摄像机坐标系平移到地表平面上,使摄像机坐标系的原点0c与世界坐标系的原点0重合;其中,地表与摄像机坐标系的原点之间的距离H为立体摄像机的架设高度;P角为立体摄像机的俯仰角,I角为立体摄像机的倾斜角。
目前,确定立体摄像机外参的方法,通常包括:
输入立体摄像机外参的初始值;
拍摄场景图像,检测场景图像中垂直于地面的垂直边缘;
根据场景中的垂直边缘投影到世界坐标系中的坐标平面上的形状与圆形的接近程度,评估立体摄像机外参的准确性;
若立体摄像机外参的准确性不符合评估标准,则需要对立体摄像机外参进行调整,并迭代上述评估过程,直到获得满足评估标准的立体摄像机外参。
可见,相关技术的这种立体摄像机外参的确定方法,需要借助场景中存在垂直于地面的垂直边缘这个参考点,才能得到准确的立体摄像机外参,对应用场景的要求较高。
发明内容
本申请实施例的目的在于提供一种立体摄像机外部参数的确定方法及装置,不需要借助场景中的参考点就能够确定立体摄像机的外部参数。具体技术方案如下:
本申请的一种实施方式公开了一种立体摄像机外部参数的确定方法,所述方法包括:获取立体摄像机所处位置的地表数据;根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
优选地,所述方法还包括:当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
优选地,所述根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程的步骤,包括:从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合, 生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
优选地,所述从所述地表数据的像素点中选取至少三个像素点的步骤,包括:使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
优选地,所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点对应的所述三维坐标的第二平面方程的步骤,包括:使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;判断所述当前平面方程是否满足预设条件;当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
优选地,所述预设条件,包括:所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
优选地,所述根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程的步骤,包括:使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平 面方程。
优选地,所述根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角的步骤,包括:在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
本申请实施方式还公开了一种立体摄像机外部参数的确定装置,所述装置包括:获取单元,用于获取立体摄像机所处位置的地表数据;第一生成单元,用于根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;第一确定单元,用于根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;第二生成单元,用于根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;第二确定单元,用于根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
优选地,所述装置还包括:滤波单元,用于当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
优选地,所述第一生成单元,包括:第一选取子单元、第一生成子单元、第一确定子单元和第二生成子单元;所述第一选取子单元,用于从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;所述第一生成子单元,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;所述第一确定 子单元,用于根据所示第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;所述第二生成子单元,用于根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
优选地,所述第一选取子单元,具体用于使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
优选地,所述第一生成子单元,包括:第二选取子单元、第三生成子单元、判断子单元、第二确定子单元和返回执行子单元;所述第二选取子单元,用于使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;所述第三生成子单元,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;所述判断子单元,用于判断所述当前平面方程是否满足预设条件;所述第二确定子单元,用于当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;所述返回执行子单元,用于当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
优选地,所述预设条件,包括:所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
优选地,所述第二生成子单元,具体用于使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点对应的三维坐标的第一平面方程。
优选地,所述第二确定单元,包括:第三确定子单元和第四确定子单元;所述第三确定子单元,用于在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度, 并将所述第一角度作为所述立体摄像机的俯仰角;以及所述第四确定子单元,用于在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
本申请实施例提供的立体摄像机外部参数的确定方法及装置,可以通过地表数据,根据地表数据中各像素点在摄像机坐标系中的三维坐标确定摄像机坐标系中的第一平面方程,使得第一平面方程适用于地表数据中的各像素点;根据摄像机坐标系中的原点与地表之间的距离确定立体摄像机的架设高度;最后,根据第一平面方程生成平面法向量,根据平面法向量确定立体摄像机的俯仰角以及立体摄像机的倾斜角。这样,不需要借助场景中的参考点,仅通过获取到的地表数据就能够确定立体摄像机的外参,适用于绝大多数应用场景,避免出现由于应用场景不符合要求而影响外参的获取,确保了立体摄像机外参的准确性,进而保证立体摄像机获取到的立体视觉图像的效果。
附图说明
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为立体摄像机外部参数的示意图;
图2为本申请实施例中的立体摄像机外部参数的确定方法的一种流程图;
图3为本申请实施例中的立体摄像机外部参数的确定方法的又一种流程图;
图4为本申请实施例中的立体摄像机外部参数的确定方法的另一种流程 图;
图5为本申请实施例中确定立体摄像机外参的示意图;
图6为本申请实施例中的立体摄像机外部参数的确定装置的一种结构图;
图7为本申请实施例中的立体摄像机外部参数的确定装置的又一种结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
方法实施例一
本申请实施例公开了一种立体摄像机外部参数的确定方法。参见图2,图2为本申请实施例的立体摄像机外部参数的确定方法的一种流程图,包括如下步骤:
步骤201,获取立体摄像机所处位置的地表数据;
需要说明的是,根据立体摄像机所处位置的地表数据确定得到的立体摄像机外参只能适用于立体摄像机在当前位置进行拍摄,比如,当前立体摄像机位于山坡上,根据山坡的地表数据确定得到的外参只适用于立体摄像机在山坡上的拍摄,而不能将根据山坡的地表数据确定得到的外参用于立体摄像机在平原上的拍摄,否则会影响立体摄像机的拍摄效果。
在实际应用中,可以使用双目摄像机生成地表的二维图像和地表的视差图,也可以使用飞行时间(Time Of Flight,TOF)深度相机生成地表的二维图像和地表的深度图,本申请对获取到的地表数据的具体形式不加以限制。
具体地,当使用双目摄像机时,地表数据可以包括地表的二维图像和视差图,双目摄像机可以根据地表的视差图,将地表的二维图像在图像坐标中 的二维坐标转换为在双目摄像机对应的摄像机坐标系中的三维坐标;其中,这里说的摄像机坐标系是以双目摄像机为原点的三维坐标系。当使用TOF深度相机时,地表数据可以包括地表的二维图像和深度图,TOF深度相机可以根据地表的深度图,将地表的二维图像在图像坐标中的二维坐标转换为在TOF深度相机对应的摄像机坐标系中的三维坐标;其中,这里说的摄像机坐标系是以TOF深度相机为原点的三维坐标系。
在本申请的一种可选实施例中,所述方法还可以包括:
当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
需要说明的是,由于不同的立体摄像机获取的数据特性不同,具体的预设条件可能随立体摄像机的种类不同而有所区别,但预设条件的基本规则是有关地表数据中的噪声值的噪声阈值;若地表数据中的噪声较大,超过所述噪声阈值,则需要对地表数据进行滤波处理,若地表数据中的噪声较小,没有超过所述噪声预置,则无需对地表数据进行滤波处理。
其中,时域中值滤波是指对于待处理的图像中的某一像素点,可以用待处理图像前后连续的多帧图像中同一位置的像素点的均值来替换所述待处理的图像中的某一个像素点,对待处理图像中的所有像素点均做同样的替换处理。空域中值滤波是指对于待处理的图像中的某一像素点,可以用待处理图像中所述某一像素点周围的3×3像素矩阵的均值来替换所述某一像素点,对待处理图像中的所有像素点均做同样的替换处理。
具体地,在某帧图像由于视差计算错误而造成的视差不准的情况时,可以使用时域中值滤波对所述某帧图像进行滤波处理,以提高所述某帧图像的成像质量;而出现由于无法对特征场景中的特殊位置进行视差计算而导致图像的成像质量较差的情况时,可以使用空域中值滤波对所述图像进行滤波处理,以提高所述图像的成像质量。
当然,对地表数据的滤波处理不是必须的,如果地表数据的质量符合预设条件,则可以省略滤波处理这一步。
接下来,可以将地表的二维图像在图像坐标系中的二维坐标转换为在摄 像机坐标系中的三维坐标,但是,在此之前,还需要先判断地表数据中的视差图或者深度图的有效性:
当地表数据包括视差图时,需要判断视差图是否有效,也就是判断平面图像中每个像素点在视差图中对应的视差值是否在合理范围之内;比如在某个场景中,所拍摄图像的最近距离和最远距离的范围是已知的,且最近距离和最远距离分别对应的视差值也是已知的,那么,如果视差图中的某个视差值超出最近距离和最远距离分别对应的视差值,则认为所述视差图中的所述某个视差值是无效的,可以忽略所述某个视差对应的平面图像中的像素点,使用平面图像中剩余的大量像素点进行后续计算。
当地表数据包括深度图时,需要判断深度图是否有效,也就是判断平面图像中每个像素点在深度图中对应的深度值是否在合理范围之内;具体判断方法与判断视差值是否有效的方法类似,也是判断深度图中的每个深度值是否在有效范围之内,如果某个深度值超出所述有效范围,则所述某个深度值是无效的,可以忽略所述某个深度值对应的平面图像中的像素点,使用平面图像中剩余的大量像素点进行后续计算。
步骤202,根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
具体地,可以先预设待确定的平面方程,其中包含多个未知参数;然后,根据地表数据中各像素在摄像机坐标系中对应的三维坐标,确定待确定的平面方程中的未知参数;最后将已知各参数值的待确定的平面方程作为第一平面方程。这样,第一平面方程能够在最大程度上贴合地表数据中像素点的分布规律,保证得到的立体摄像机外参的准确性。
步骤203,根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
其中,由于立体摄像机对应的摄像机坐标系中的原点即为立体摄像机,因此,可以计算出摄像机坐标系中的原点与地表之间的距离,并将所述距离确定为立体摄像机的架设高度;其中,立体摄像机的架设高度为三个立体摄 像机外参之一。
步骤204,根据所述第一平面方程,确定所述第一平面方程对应的平面法向量;
本步骤可以与相关技术相同,可以根据步骤203得到的第一平面方程计算出第一平面方程对应的平面法向量,以计算出立体摄像机的俯仰角和倾斜角。
步骤205,根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
具体地,在本申请的又一种可选实施例中,步骤205具体可以包括:
在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及
在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角。
其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
可见,应用本申请实施例,能够通过地表数据,并根据地表数据中各像素点在摄像机坐标系中的三维坐标以确定第一平面方程,其中,第一平面方程能够体现所述地表数据中所有像素点的分布规律;接下来,将摄像机坐标系中的原点和地表之间的距离确定立体摄像机的架设高度,并且生成第一平面方程的平面法向量;根据平面法向量,确定立体摄像机的俯仰角以及立体摄像机的倾斜角。这样,仅通过获取地表数据,不需要借助场景中的参考点就能够确定立体摄像机的外参,不仅适用于绝大多数应用场景,而且避免出现由于应用场景不符合要求而影响外参的获取,确保了立体摄像机外参的准确性。
方法实施例二
参见图3,图3为本申请实施例的立体摄像机外部参数的确定方法的又一种流程图,包括如下步骤:
步骤301,获取立体摄像机所处位置的地表数据;
步骤302,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
具体地,可以预先设定第二平面方程如公式(1)所示:
a’x+b’y+c’z+d’=0           (1)
接下来,将三个像素点对应的三维坐标代入公式(1),解出公式(1)中的a’、b’、c’和d’。
在本申请的一种优选实施例中,如图4所示,图4为本申请实施例中的立体摄像机外部参数的确定方法的另一种流程图,所述步骤303具体可以包括以下子步骤:
子步骤11,使用随机一致性抽样(RANdom SAmple Consensus,RANSAC)算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
当然,也可以使用其他算法从地表数据的像素点中选取至少三个像素点,本申请对从地表数据中选取至少三个像素点的具体方法不加以限制。
子步骤12,根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
子步骤13,判断所述当前平面方程是否满足预设条件;
子步骤14,当所述当前平面方程满足预设条件时,确定所述当前平面方 程为第二平面方程;
子步骤15,当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回子步骤11。
其中,迭代次数的初始值为0。
在本申请的又一种优选实施例中,所述预设条件,具体可以包括:
所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
比如,第一阈值可以是地表数据的像素点中符合当前平面方程的像素点的具体个数,也可以是地表数据的像素点中符合当前平面方程的像素点个数占地表数据的总像素点个数的百分比;第一阈值和第二阈值可以根据实际情况进行设定;本申请对第一阈值的具体表现形式不加以限制。
步骤303,根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
具体地,可以根据步骤302中确定的第二平面方程,如公式(1)所示,从地表数据中的像素点中选择所有符合第二平面方程的像素点,并将这些像素点对应的三维坐标作为第二样本集合。
步骤304,根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程;
在本申请的另一种优选实施例中,所述步骤305具体可以为:
使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
下面举例对生成第一平面方程的具体过程进行详细说明:
第一步:已知第二样本集合中有n个像素点,分别对应的三维坐标为(x1,y1,z1),(x2,y2,z2),…,(xn,yn,zn)。同时,可以预设第一平面方程如公式(2) 所示:
ax+by+cz+d=0          (2)
将公式(2)除以d,得到修改后的第一平面方程,如公式(3)所示:
Figure PCTCN2017105061-appb-000001
在公式(3)中,
Figure PCTCN2017105061-appb-000002
将第二样本集合中的n个像素点分别对应的三维坐标带入修改后的第一平面方程,如公式(3)所示,可得:
Figure PCTCN2017105061-appb-000003
在公式(4)中,
Figure PCTCN2017105061-appb-000004
其中,公式(4)中方程可以写为矩阵形式,如公式(5)所示:
AX=B        (5)
在公式(5)中,矩阵A为由所有三维点组成的N×3矩阵,矩阵X为
Figure PCTCN2017105061-appb-000005
Figure PCTCN2017105061-appb-000006
Figure PCTCN2017105061-appb-000007
组成的1×3矩阵,矩阵B为[-1;-1;-1]。
第二步:使用最小二乘法解公式(5),可得:
X=(ATA)-1ATb            (6)
在公式(6)中,X即为公式(5)的最小二乘解;由矩阵AT为矩阵A的转置矩阵,矩阵(ATA)-1为矩阵ATA的逆矩阵,可得(ATA)-1AT为对矩阵A的求伪逆后的值。
第三步:由于公式(6)解出的矩阵X为
Figure PCTCN2017105061-appb-000008
Figure PCTCN2017105061-appb-000009
组成的1×3矩阵,因此,可以由矩阵X确定公式(3)中修改后的第一平面方程中的
Figure PCTCN2017105061-appb-000010
Figure PCTCN2017105061-appb-000011
进而计算出公式(2)中第一平面方程中的a、b、c和d,最终得到第一平面方程的具体形式。
步骤305,根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
步骤306,根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
步骤307,在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;
步骤308,在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角。
下面对计算立体摄像机的三个外部参数的具体过程进行详细说明:
如图5所示,图5为确定立体摄像机外参的示意图。在图5中,图上部的由xc轴、zc轴和yc轴组合成的三维坐标系为立体摄像机对应的摄像机坐标系,立体摄像机为摄像机坐标系的原点,标识为0c;在地表平面上用虚线标识的由x轴、z轴和y轴组合成的三维坐标系为世界坐标系,原点为0。将摄像机坐标系平移到地表平面上,使摄像机坐标系的原点0c与世界坐标系的原点0重合;
Figure PCTCN2017105061-appb-000012
为步骤305计算出的第一平面方程对应的平面法向量
Figure PCTCN2017105061-appb-000013
其中,平面法向量
Figure PCTCN2017105061-appb-000014
可能存在两个方向,即为图5中标识的方向,或者与图5中标识方向相反的方向。在图5中,高度H为立体摄像机的架设高度,角度P为立体摄像机的俯仰角,角度I为立体摄像机的倾斜角;具体地,俯仰角P为当立体摄像机由标准姿态旋转到如图5中所述的当前姿态时,需要将zc轴以顺时针方向绕x轴旋转的角度,倾斜角I为立体摄像机由标准姿态旋转到如图5中所述的当前姿态时,需要将xc轴以顺时针方向绕z轴旋转的角度;其中,立体摄像机的标准姿态指的是当摄像机坐标系中的xc轴和zc轴与世界坐标系中的x轴和z轴的方向一致,且摄像机坐标系中的yc轴与世界坐标系中的y轴的方向相反时,对应立体摄像机的姿态,可以理解的,当立体摄像机处于标准姿态时,俯仰角P和倾斜角I均为0。
首先,如图5所示,摄像机坐标系中的原点与所述地表之间的距离的表达式如公式(7)所示,
Figure PCTCN2017105061-appb-000015
在公式(7)中,H为立体摄像机的架设高度,a、b、c和d为第一平面方程中的参数,x1、y1和z1为摄像机坐标系中的原点坐标,也就是x1=0、y1=0和z1=0。
接下来,可以通过平面法向量
Figure PCTCN2017105061-appb-000016
在yc轴和zc轴上的分量的正负来判断立体摄像机姿态,进而求解立体摄像机的俯仰角P,计算公式如公式(8)至(12)所示:
Figure PCTCN2017105061-appb-000017
时,
Figure PCTCN2017105061-appb-000018
Figure PCTCN2017105061-appb-000019
时,
Figure PCTCN2017105061-appb-000020
Figure PCTCN2017105061-appb-000021
时,
Figure PCTCN2017105061-appb-000022
Figure PCTCN2017105061-appb-000023
时,
Figure PCTCN2017105061-appb-000024
在公式(8)至(11)中,
Figure PCTCN2017105061-appb-000025
a、b和c为第一平面方程中的参数。
最后,求解立体摄像机的倾斜角I的计算公式如公式(12)和公式(13)所示:
Figure PCTCN2017105061-appb-000026
时,
Figure PCTCN2017105061-appb-000027
Figure PCTCN2017105061-appb-000028
时,
Figure PCTCN2017105061-appb-000029
在公式(12)和公式(13)中,
Figure PCTCN2017105061-appb-000030
a、b和c为第一平面方程中的参数。
这样就能够确定立体摄像机对应的三个外部参数,以便立体摄像机能够获取到高质量的立体视觉图像
可见,应用本申请实施例,能够根据地表数据中各像素点在摄像机坐标系中的三维坐标,经过多次计算迭代生成第二平面方程;接下来,确定地表数据的像素点中所有符合第二平面方程的像素点,对所述像素点进行最小二乘计算,得出能够体现地表数据中所有像素点的分布规律的第一平面方程;进而根据第一平面方程的平面法向量和摄像机坐标系的原点,确定立体摄像机的外参。这样,通过地表数据确定的立体摄像机的外参的方法能够适用于绝大多数应用场景,不仅使用方便而且确保得到的外参是准确可靠的。
装置实施例一
参见图6,图6为本申请实施例的立体摄像机外部参数的确定装置的一种结构图,该装置与图2所示的方法流程相对应,具体可以包括以下单元:
获取单元601,用于获取立体摄像机所处位置的地表数据;
第一生成单元602,用于根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
第一确定单元603,用于根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
第二生成单元604,用于根据所述第一平面方程,生成所述第一平面方程 对应的平面法向量;
第二确定单元605,用于根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
在本申请的一种优选实施例中,所述装置还包括:
滤波单元,用于当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
可见,本申请装置实施例能够通过地表数据,并根据地表数据中各像素点在摄像机坐标系中的三维坐标以确定第一平面方程,其中,第一平面方程能够体现所述地表数据中所有像素点的分布规律;接下来,将摄像机坐标系中的原点和地表之间的距离确定立体摄像机的架设高度,并且生成第一平面方程的平面法向量;根据平面法向量,确定立体摄像机的俯仰角以及立体摄像机的倾斜角。这样,仅通过获取地表数据,不需要借助场景中的参考点就就能够确定立体摄像机的外参,不仅适用于绝大多数应用场景,而且避免出现由于应用场景不符合要求而影响外参的获取,确保了立体摄像机外参的准确性。
装置实施例二
参见图7,图7为本申请实施方式的立体摄像机外部参数的确定装置的又一种结构图,该装置与图3所示的方法流程相对应,该装置包括:获取单元701、第一生成单元702、第一确定单元703、第二生成单元704和第二确定单元705;其中,获取单元701与图6所示获取单元601可以完全相同,第一确定单元703与图6所示第一确定单元603可以完全相同,第二生成单元704与图6所示第二生成单元604可以完全相同,这里不再赘述。
所述第一生成单元702,具体包括:第一选取子单元706、第一生成子单元707、第一确定子单元708和第二生成子单元709;
所述第一选取子单元706,用于从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对 应的三维坐标作为第一样本集合;
所述第一生成子单元707,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
所述第一确定子单元708,用于根据所示第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
所述第二生成子单元709,用于根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
在本申请的一种优选实施例中,所述第一选取子单元706,具体用于使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
在本申请的又一种优选实施例中,所述第一生成子单元707,具体包括:第二选取子单元710、第三生成子单元711、判断子单元712、第二确定子单元713和返回执行子单元714;
所述第二选取子单元710,用于使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
所述第三生成子单元711,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
所述判断子单元712,用于判断所述当前平面方程是否满足预设条件;
所述第二确定子单元713,用于当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
所述返回执行子单元714,用于当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个 像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
在本申请的另一种优选实施例中,所述预设条件,包括:
所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
在本申请的再一种优选实施例中,所述第二生成子单元709,具体用于使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点对应的三维坐标的第一平面方程。
在本申请的再一种优选实施例中,所述第二确定单元705,包括:第三确定子单元715和第四确定子单元716;
所述第三确定子单元715,用于在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及
所述第四确定子单元716,用于在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
可见,本申请装置实施例能够根据地表数据中各像素点在摄像机坐标系中的三维坐标,经过多次计算迭代生成第二平面方程;接下来,确定地表数据的像素点中所有符合第二平面方程的像素点,对所述像素点进行最小二乘计算,得出能够体现地表数据中所有像素点的分布规律的第一平面方程;进而根据第一平面方程的平面法向量和摄像机坐标系的原点,确定立体摄像机的外参。这样,通过地表数据确定的立体摄像机的外参的方法能够适用于绝大多数应用场景,不仅使用方便而且确保得到的外参是准确可靠的。
本申请实施例再公开了一种存储介质,用于存储可执行代码,所述可执行代码用于在运行时执行如下步骤:
获取立体摄像机所处位置的地表数据;
根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
可选的,所述方法还包括:
当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
可选的,所述根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程的步骤,包括:
从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据 的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述从所述地表数据的像素点中选取至少三个像素点的步骤,包括:
使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
可选的,所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点对应的所述三维坐标的第二平面方程的步骤,包括:
使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
判断所述当前平面方程是否满足预设条件;
当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
可选的,所述预设条件,包括:
所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
可选的,所述根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程的步骤,包括:
使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角的步骤,包括:
在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及
在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
可见,本申请存储介质实施例能够根据地表数据中各像素点在摄像机坐标系中的三维坐标,经过多次计算迭代生成第二平面方程;接下来,确定地表数据的像素点中所有符合第二平面方程的像素点,对所述像素点进行最小二乘计算,得出能够体现地表数据中所有像素点的分布规律的第一平面方程;进而根据第一平面方程的平面法向量和摄像机坐标系的原点,确定立体摄像机的外参。这样,通过地表数据确定的立体摄像机的外参的方法能够适用于绝大多数应用场景,不仅使用方便而且确保得到的外参是准确可靠的。
本申请实施例再公开了一种应用程序,用于在运行时执行如下步骤:
获取立体摄像机所处位置的地表数据;
根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
可选的,所述方法还包括:
当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
可选的,所述根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程的步骤,包括:
从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述从所述地表数据的像素点中选取至少三个像素点的步骤,包括:
使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
可选的,所述从所述地表数据的像素点中选取至少三个像素点,将所述 至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点对应的所述三维坐标的第二平面方程的步骤,包括:
使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
判断所述当前平面方程是否满足预设条件;
当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
可选的,所述预设条件,包括:
所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
可选的,所述根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程的步骤,包括:
使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角的步骤,包括:
在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为 所述立体摄像机的俯仰角;以及
在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
可见,本申请应用程序实施例能够根据地表数据中各像素点在摄像机坐标系中的三维坐标,经过多次计算迭代生成第二平面方程;接下来,确定地表数据的像素点中所有符合第二平面方程的像素点,对所述像素点进行最小二乘计算,得出能够体现地表数据中所有像素点的分布规律的第一平面方程;进而根据第一平面方程的平面法向量和摄像机坐标系的原点,确定立体摄像机的外参。这样,通过地表数据确定的立体摄像机的外参的方法能够适用于绝大多数应用场景,不仅使用方便而且确保得到的外参是准确可靠的。
本申请实施例再公开了一种立体摄像机外部参数的确定设备,包括:控制器、存储器、通信接口和总线;
所述控制器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
所述存储器用于存储可执行程序代码;
所述控制器,用于通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以执行如下步骤:
获取立体摄像机所处位置的地表数据;
根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
可选的,所述方法还包括:
当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
可选的,所述根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程的步骤,包括:
从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述从所述地表数据的像素点中选取至少三个像素点的步骤,包括:
使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
可选的,所述从所述地表数据的像素点中选取至少三个像素点,将所述 至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点对应的所述三维坐标的第二平面方程的步骤,包括:
使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
判断所述当前平面方程是否满足预设条件;
当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
可选的,所述预设条件,包括:
所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
可选的,所述根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程的步骤,包括:
使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
可选的,所述根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角的步骤,包括:
在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为 所述立体摄像机的俯仰角;以及
在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
可见,本申请立体摄像机外部参数的确定设备实施例能够根据地表数据中各像素点在摄像机坐标系中的三维坐标,经过多次计算迭代生成第二平面方程;接下来,确定地表数据的像素点中所有符合第二平面方程的像素点,对所述像素点进行最小二乘计算,得出能够体现地表数据中所有像素点的分布规律的第一平面方程;进而根据第一平面方程的平面法向量和摄像机坐标系的原点,确定立体摄像机的外参。这样,通过地表数据确定的立体摄像机的外参的方法能够适用于绝大多数应用场景,不仅使用方便而且确保得到的外参是准确可靠的。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描 述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (19)

  1. 一种立体摄像机外部参数的确定方法,其特征在于,所述方法包括:
    获取立体摄像机所处位置的地表数据;
    根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
    根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
    根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
    根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程的步骤,包括:
    从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
    根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
    根据所述第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
    根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
  4. 根据权利要求3所述的方法,其特征在于,所述从所述地表数据的像素点中选取至少三个像素点的步骤,包括:
    使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
  5. 根据权利要求4所述的方法,其特征在于,所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;根据所述第一样本集合,生成符合所述第一样本集合中各像素点对应的所述三维坐标的第二平面方程的步骤,包括:
    使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
    根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
    判断所述当前平面方程是否满足预设条件;
    当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
    当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
  6. 根据权利要求5所述的方法,其特征在于,所述预设条件,包括:
    所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
  7. 根据权利要求3所述的方法,其特征在于,所述根据所述第二样本集 合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程的步骤,包括:
    使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
  8. 根据权利要求1所述的方法,其特征在于,所述根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角的步骤,包括:
    在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及
    在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
    其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
  9. 一种立体摄像机外部参数的确定装置,其特征在于,所述装置包括:
    获取单元,用于获取立体摄像机所处位置的地表数据;
    第一生成单元,用于根据所述地表数据中各像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标,在所述摄像机坐标系中生成符合所述各像素点对应的三维坐标的第一平面方程;
    第一确定单元,用于根据所述摄像机坐标系中的原点与所述地表之间的距离,确定所述立体摄像机的架设高度;
    第二生成单元,用于根据所述第一平面方程,生成所述第一平面方程对应的平面法向量;
    第二确定单元,用于根据所述平面法向量,确定所述立体摄像机的俯仰角以及所述立体摄像机的倾斜角。
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:
    滤波单元,用于当所述地表数据不符合预设条件时,对所述地表数据进行滤波处理;其中,所述滤波处理包括时域中值滤波和空域中值滤波。
  11. 根据权利要求9所述的装置,其特征在于,所述第一生成单元,包括:第一选取子单元、第一生成子单元、第一确定子单元和第二生成子单元;
    所述第一选取子单元,用于从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的摄像机坐标系中对应的三维坐标作为第一样本集合;
    所述第一生成子单元,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的第二平面方程;
    所述第一确定子单元,用于根据所示第二平面方程,在所述地表数据中的像素点中确定所有符合所述第二平面方程的像素点,并将所述符合所述第二平面方程的像素点在所述摄像机坐标系中对应的三维坐标作为第二样本集合;
    所述第二生成子单元,用于根据所述第二样本集合,在所述摄像机坐标系中生成符合所述地表数据的像素点在所述摄像机坐标系中对应的三维坐标的第一平面方程。
  12. 根据权利要求11所述的装置,其特征在于,所述第一选取子单元,具体用于使用随机一致性抽样RANSAC算法,从所述地表数据的像素点中选取至少三个像素点。
  13. 根据权利要求12所述的装置,其特征在于,所述第一生成子单元,包括:第二选取子单元、第三生成子单元、判断子单元、第二确定子单元和返回执行子单元;
    所述第二选取子单元,用于使用RANSAC算法,从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述立体摄像机对应的 摄像机坐标系中对应的三维坐标作为第一样本集合;
    所述第三生成子单元,用于根据所述第一样本集合,生成符合所述第一样本集合中各像素点在所述摄像机坐标系中对应的三维坐标的当前平面方程;
    所述判断子单元,用于判断所述当前平面方程是否满足预设条件;
    所述第二确定子单元,用于当所述当前平面方程满足预设条件时,确定所述当前平面方程为第二平面方程;
    所述返回执行子单元,用于当所述当前平面方程不满足预设条件时,所述迭代次数加1,并返回执行所述从所述地表数据的像素点中选取至少三个像素点,将所述至少三个像素点在所述摄像机坐标系中对应的三维坐标作为第一样本集合的步骤;其中,所述迭代次数的初始值为0。
  14. 根据权利要求13所述的装置,其特征在于,所述预设条件,包括:
    所述地表数据的像素点中符合所述当前平面方程的像素点个数达到预设第一阈值,或者所述当前平面方程对应的迭代次数达到预设第二阈值。
  15. 根据权利要求11所述的装置,其特征在于,所述第二生成子单元,具体用于使用最小二乘法对所述第二样本集合进行拟合处理,生成符合所述地表数据的像素点对应的三维坐标的第一平面方程。
  16. 根据权利要求9所述的装置,其特征在于,所述第二确定单元,包括:第三确定子单元和第四确定子单元;
    所述第三确定子单元,用于在所述摄像机坐标系中,确定在所述立体摄像机由标准姿态旋转到当前姿态时对应zc轴以顺时针方向绕x轴旋转的第一角度,并将所述第一角度作为所述立体摄像机的俯仰角;以及
    所述第四确定子单元,用于在所述摄像机坐标系中,确定在所述立体摄像机由所述标准姿态旋转到所述当前姿态时对应xc轴以顺时针方向绕z轴旋转的第二角度,并将所述第二角度作为所述立体摄像机的倾斜角;
    其中,由所述xc轴、所述zc轴和yc轴组成的三维坐标系为所述摄像机坐标系;由所述x轴、所述z轴和y轴组成的三维坐标系为世界坐标系;当所述xc轴 和所述zc轴与所述x轴和所述z轴的方向一致,且所述yc轴与所述y轴的方向相反时,对应所述立体摄像机的姿态为所述标准姿态。
  17. 一种存储介质,其特征在于,用于存储可执行代码,所述可执行代码用于在运行时执行如权利要求1-8任一项所述的立体摄像机外部参数的确定方法。
  18. 一种应用程序,其特征在于,用于在运行时执行如权利要求1-8任一项所述的立体摄像机外部参数的确定方法。
  19. 一种立体摄像机外部参数的确定设备,其特征在于,包括:控制器、存储器、通信接口和总线;
    所述控制器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
    所述存储器用于存储可执行程序代码;
    所述控制器,用于通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以执行如权利要求1-8任一项所述的立体摄像机外部参数的确定方法。
PCT/CN2017/105061 2016-10-12 2017-09-30 一种立体摄像机外部参数的确定方法及装置 WO2018068678A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17860823.8A EP3528209A1 (en) 2016-10-12 2017-09-30 Method and device for determining external parameter of stereoscopic camera
US16/340,901 US11010924B2 (en) 2016-10-12 2017-09-30 Method and device for determining external parameter of stereoscopic camera

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610889992.7 2016-10-12
CN201610889992.7A CN107945234A (zh) 2016-10-12 2016-10-12 一种立体摄像机外部参数的确定方法及装置

Publications (1)

Publication Number Publication Date
WO2018068678A1 true WO2018068678A1 (zh) 2018-04-19

Family

ID=61905164

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105061 WO2018068678A1 (zh) 2016-10-12 2017-09-30 一种立体摄像机外部参数的确定方法及装置

Country Status (4)

Country Link
US (1) US11010924B2 (zh)
EP (1) EP3528209A1 (zh)
CN (1) CN107945234A (zh)
WO (1) WO2018068678A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966207A (zh) * 2021-01-28 2021-06-15 北京清源能控科技有限公司 一种基于图像采集的振动监测方法

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108510540B (zh) * 2017-02-23 2020-02-07 杭州海康威视数字技术股份有限公司 立体视觉摄像机及其高度获取方法
CN108082083B (zh) * 2018-01-16 2019-11-01 京东方科技集团股份有限公司 一种被遮挡对象的显示方法和显示系统以及车载防撞系统
US11202055B2 (en) * 2018-02-28 2021-12-14 Blackberry Limited Rapid ground-plane discrimination in stereoscopic images
US10957074B2 (en) * 2019-01-29 2021-03-23 Microsoft Technology Licensing, Llc Calibrating cameras using human skeleton
CN111750850B (zh) * 2019-03-27 2021-12-14 杭州海康威视数字技术股份有限公司 角度信息获取方法、装置和系统
CN111292380B (zh) * 2019-04-02 2022-12-02 展讯通信(上海)有限公司 图像处理方法及装置
CN112541950A (zh) * 2019-09-20 2021-03-23 杭州海康机器人技术有限公司 一种深度相机外参的标定方法、及装置
CN111573220B (zh) * 2020-05-25 2022-03-11 莆田学院 一种基于物联网的快递包裹分拣调整方法
CN112070885B (zh) * 2020-08-31 2024-05-14 中国科学院空天信息创新研究院 一种基于摄影测量光度立体模型的三维重建方法和系统
CN114765667A (zh) * 2021-01-13 2022-07-19 安霸国际有限合伙企业 用于多视图拼接的固定图案校准
CN112884727A (zh) * 2021-01-28 2021-06-01 华北电力大学(保定) 一种风力机叶片振动监测方法
CN113206994B (zh) * 2021-03-30 2023-03-28 华为技术有限公司 摄像机自动工勘方法、装置、电子设备、芯片及存储介质
CN113055601B (zh) * 2021-03-30 2023-01-10 Oppo广东移动通信有限公司 双目拍摄矫正方法、双目拍摄矫正装置和电子设备
CN113284197B (zh) * 2021-07-22 2021-11-23 浙江华睿科技股份有限公司 Agv的tof相机外参标定方法及装置、电子设备
CN113808195B (zh) * 2021-08-26 2024-04-12 领翌技术(横琴)有限公司 视觉定位方法、装置及存储介质
CN113808216A (zh) * 2021-08-31 2021-12-17 上海商汤临港智能科技有限公司 相机标定方法及装置、电子设备和存储介质
US11887338B2 (en) * 2022-06-16 2024-01-30 Motional Ad Llc Maintaining calibration of an IBIS camera
CN117291907B (zh) * 2023-11-22 2024-01-30 百强阀门集团有限公司 一种阀门密封面检测方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102736634A (zh) * 2012-07-10 2012-10-17 浙江捷尚视觉科技有限公司 一种用于汽车全景图的摄像头角度调节方法
US20150310616A1 (en) * 2013-03-13 2015-10-29 Electronic Scripting Products, Inc. Reduced Homography for Recovery of Pose Parameters of an Optical Apparatus producing Image Data with Structural Uncertainty
CN105474634A (zh) * 2013-08-30 2016-04-06 歌乐株式会社 摄像机校准装置、摄像机校准系统及摄像机校准方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101619076B1 (ko) * 2009-08-25 2016-05-10 삼성전자 주식회사 모바일 플랫폼의 동적 물체 검출 및 추적 방법
EP2615580B1 (en) * 2012-01-13 2016-08-17 Softkinetic Software Automatic scene calibration
CN104574342B (zh) * 2013-10-14 2017-06-23 株式会社理光 视差深度图像的噪声识别方法和噪声识别装置
CN105007475B (zh) * 2014-04-17 2017-08-04 聚晶半导体股份有限公司 产生深度信息的方法与装置
CN104463856B (zh) * 2014-11-25 2017-06-27 大连理工大学 基于法向量球的室外场景三维点云数据的地面提取方法
CN104680496B (zh) * 2015-03-17 2018-01-05 山东大学 一种基于彩色图像分割的Kinect深度图修复方法
US20170359561A1 (en) * 2016-06-08 2017-12-14 Uber Technologies, Inc. Disparity mapping for an autonomous vehicle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102736634A (zh) * 2012-07-10 2012-10-17 浙江捷尚视觉科技有限公司 一种用于汽车全景图的摄像头角度调节方法
US20150310616A1 (en) * 2013-03-13 2015-10-29 Electronic Scripting Products, Inc. Reduced Homography for Recovery of Pose Parameters of an Optical Apparatus producing Image Data with Structural Uncertainty
CN105474634A (zh) * 2013-08-30 2016-04-06 歌乐株式会社 摄像机校准装置、摄像机校准系统及摄像机校准方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FENG, YICONG: "The Quickly Automated Extraction of Building Facades Information from Mobile LiDAR Point Clouds", DOCTORAL DISSERTATION, 30 November 2015 (2015-11-30), pages 1 - 130, XP009515646, ISSN: 1674-022X *
See also references of EP3528209A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966207A (zh) * 2021-01-28 2021-06-15 北京清源能控科技有限公司 一种基于图像采集的振动监测方法

Also Published As

Publication number Publication date
CN107945234A (zh) 2018-04-20
EP3528209A4 (en) 2019-08-21
EP3528209A1 (en) 2019-08-21
US20190236807A1 (en) 2019-08-01
US11010924B2 (en) 2021-05-18

Similar Documents

Publication Publication Date Title
WO2018068678A1 (zh) 一种立体摄像机外部参数的确定方法及装置
CN110568447B (zh) 视觉定位的方法、装置及计算机可读介质
JP5946924B2 (ja) シーン構造ベース自己姿勢推定
CN107705333B (zh) 基于双目相机的空间定位方法及装置
WO2018153374A1 (zh) 相机标定
WO2020206903A1 (zh) 影像匹配方法、装置及计算机可读存储介质
KR101666959B1 (ko) 카메라로부터 획득한 영상에 대한 자동보정기능을 구비한 영상처리장치 및 그 방법
CN106485753B (zh) 用于无人驾驶汽车的摄像机标定的方法和装置
WO2015096508A1 (zh) 一种模型约束下的在轨三维空间目标姿态估计方法及系统
CN111127524A (zh) 一种轨迹跟踪与三维重建方法、系统及装置
JP6174104B2 (ja) 室内2d平面図の生成方法、装置及びシステム
CN109523581A (zh) 一种三维点云对齐的方法和装置
WO2020119467A1 (zh) 高精度稠密深度图像的生成方法和装置
CN112083403B (zh) 用于虚拟场景的定位追踪误差校正方法及系统
CN111402345B (zh) 基于多目全景图像的模型生成方法及装置
KR20240089161A (ko) 촬영 측정 방법, 장치, 기기 및 저장 매체
CN111882655A (zh) 三维重建的方法、装置、系统、计算机设备和存储介质
CN106558038B (zh) 一种水天线检测方法及装置
DK3189493T3 (en) PERSPECTIVE CORRECTION OF DIGITAL PHOTOS USING DEPTH MAP
WO2021193672A1 (ja) 三次元モデル生成方法及び三次元モデル生成装置
KR101781515B1 (ko) 다면체를 이용한 카메라 칼리브레이션 시스템 및 방법
CN117409149A (zh) 基于立体约束的光束法平差方程的三维建模方法及系统
JP6086491B2 (ja) 画像処理装置およびそのデータベース構築装置
CN113793379A (zh) 相机姿态求解方法及系统、设备和计算机可读存储介质
KR102107465B1 (ko) 방향코사인을 이용한 에피폴라 영상 제작 시스템 및 그 제작 방법

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: 17860823

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017860823

Country of ref document: EP

Effective date: 20190513