WO2012160787A1 - Position/posture estimation device, position/posture estimation method and position/posture estimation program - Google Patents

Position/posture estimation device, position/posture estimation method and position/posture estimation program Download PDF

Info

Publication number
WO2012160787A1
WO2012160787A1 PCT/JP2012/003240 JP2012003240W WO2012160787A1 WO 2012160787 A1 WO2012160787 A1 WO 2012160787A1 JP 2012003240 W JP2012003240 W JP 2012003240W WO 2012160787 A1 WO2012160787 A1 WO 2012160787A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimensional coordinates
orientation
posture
input
unit
Prior art date
Application number
PCT/JP2012/003240
Other languages
French (fr)
Japanese (ja)
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 日本電気株式会社
Publication of WO2012160787A1 publication Critical patent/WO2012160787A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/03Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness by measuring coordinates of points
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/26Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes
    • 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
    • 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 a position / orientation estimation apparatus, a position / orientation estimation method, and a position / orientation estimation program for estimating the position and orientation of a camera or a subject (hereinafter collectively referred to as “position and orientation”).
  • the camera position or posture of the subject Must be estimated with high accuracy.
  • estimating the position and orientation of a camera that moves around a stationary subject and estimating the position and orientation of a subject that moves in front of a stationary camera are equivalent problems. Therefore, the former case will be described as an example.
  • the known 3D coordinates for a plurality of points and the 2D coordinates corresponding to these 3D coordinates on the image are input.
  • PnP Perspective n Points
  • Non-Patent Document 1 describes a method for estimating a position and orientation using a DLT (Direct Linear Transform) method.
  • the method described in Non-Patent Document 1 ignores the constraint condition relating to the posture rotation matrix and treats each posture variable independently to convert a non-linear reprojection error into a linear algebraic error.
  • the position and orientation is obtained as an eigenvector corresponding to the absolute minimum eigenvalue of the coefficient matrix, and post-correction is performed so as to satisfy the constraint condition of the orientation.
  • the reprojection error is the Euclidean distance between the two-dimensional coordinates obtained by projecting the three-dimensional coordinates onto the image based on the estimated position and orientation and the input two-dimensional coordinates.
  • the plane DLT method using four or more points is used.
  • a non-planar DLT method using 6 points or more is used.
  • Non-Patent Document 2 describes a method of estimating the distance from the camera position to each point and estimating the position and orientation from the distance.
  • the method described in Non-Patent Document 2 defines a plurality of quaternary expressions related to the depth of an appropriate one-dimensional three-dimensional coordinate. Then, the method treats each term of the quartic equation independently, and estimates the distance from a singular vector obtained by singular value decomposition of the coefficient matrix. Since the three-dimensional coordinates in the camera coordinate system are obtained from the distance, the position and orientation are estimated by the least square method from the input three-dimensional coordinates and the three-dimensional coordinates in the camera coordinate system.
  • Non-Patent Document 1 and Non-Patent Document 2 calculate by ignoring part or all of the constraint conditions between variables. Therefore, the obtained position and orientation is not a global optimum solution that minimizes the reprojection error.
  • Non-Patent Document 3 describes that the solution obtained by the position and orientation estimation method as described above is used as an initial value so that the reprojection error is minimized by the bundle adjustment method.
  • a method of optimization is described.
  • the bundle adjustment method is a method of performing nonlinear optimization of the position and orientation so that the sum of squares of the reprojection error is minimized.
  • Newton method Levenberg-Marquardt method or the like is used.
  • Non-Patent Document 1 Since the position / orientation estimation method described in Non-Patent Document 1 needs to change the calculation method according to the distribution of three-dimensional coordinates and the number of input points, there is a problem that the estimation accuracy of the position / orientation may be lowered. It was. For example, when the distribution of three-dimensional coordinates is close to a plane with 6 points or more, it may be more accurate to use the planar DLT method instead of the non-planar DLT method.
  • Non-Patent Document 2 The position / orientation estimation method described in Non-Patent Document 2 does not depend on the distribution of the three-dimensional coordinates, but the numerical calculation becomes unstable when the number of input points is increased, so that the position / orientation estimation accuracy decreases. There was a problem. Furthermore, when the number of input points is increased, there is a problem that the calculation cost for estimation increases.
  • the initial value is a global optimum. If it is not close enough to the solution, there is a problem that it converges or diverges to the local optimal solution. Furthermore, in the nonlinear optimization method, it is necessary to solve the linear equation repeatedly, and there is a problem that the calculation cost is high.
  • an object of the present invention is to provide a position / orientation estimation apparatus, a position / orientation estimation method, and a position / orientation estimation program capable of estimating the position and orientation of a camera or a subject with high accuracy and stability. More specifically, “stable” means that numerical calculation does not become unstable even if the number of input points is increased (for example, 5 points or more). Also, the calculation cost does not exceed a predetermined range even if the number of input points is increased.
  • the position / orientation estimation apparatus receives a set of three or more three-dimensional coordinates related to an object and a two-dimensional coordinate corresponding to the three-dimensional coordinate on the image, and inputs the set of the input three-dimensional coordinate and the two-dimensional coordinate.
  • attitude of 3 degrees of freedom as a variable, all solutions satisfying the simultaneous polynomial with the gradient of the error function as zero are calculated for a predetermined error function representing the conversion relationship between the 3D coordinates and the 2D coordinates.
  • Optimal solution candidate calculation means and a camera that has captured the object based on the extracted optimal solution, extracting the optimal solution with the smallest error function from all the solutions of simultaneous polynomials calculated by the optimal solution candidate calculation means And a position / orientation calculating means for calculating the position / orientation.
  • the position and orientation estimation method receives a set of three or more three-dimensional coordinates related to an object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image, and inputs the inputted three-dimensional coordinates and two-dimensional coordinates.
  • a set of three degrees of freedom as a variable, all solutions satisfying a simultaneous polynomial with the gradient of the error function as zero for a given error function representing the conversion relationship between 3D coordinates and 2D coordinates are expressed.
  • the position / orientation estimation program uses a set of three or more three-dimensional coordinates relating to an input object and a two-dimensional coordinate corresponding to the three-dimensional coordinates on the image to the computer. Processing for calculating all solutions satisfying the simultaneous polynomial with the gradient of the error function as zero, for a predetermined error function representing the conversion relationship between the three-dimensional coordinates and the two-dimensional coordinates, using as a variable, and the calculated simultaneous polynomial An optimal solution that minimizes the error function is extracted from all the solutions, and a process for calculating the position and orientation of the camera that captured the object is executed based on the extracted optimal solution.
  • the position and orientation of the camera or subject can be estimated with high accuracy and stability.
  • FIG. FIG. 1 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the first embodiment of the present invention.
  • the position / orientation estimation apparatus shown in FIG. 1 includes an optimal solution candidate calculation unit 1 and a position / orientation calculation unit 2.
  • Optimal solution candidate calculation unit 1 receives three or more three-dimensional coordinates and two-dimensional coordinates corresponding to the three-dimensional coordinates as input, and converts the three-degree-of-freedom camera posture as a variable to convert three-dimensional coordinates and two-dimensional coordinates.
  • a processing unit that outputs a solution of a simultaneous polynomial (hereinafter simply referred to as a simultaneous polynomial) in which the gradient of the error function representing the relationship is zero, and includes a coefficient calculation unit 11 and a simultaneous polynomial solution unit 12 in this example. .
  • the coefficient calculation unit 11 receives the three-dimensional coordinates and the two-dimensional coordinates as input, calculates the coefficients of the simultaneous polynomial, and outputs them to the simultaneous polynomial solving unit 12.
  • the simultaneous polynomial solving unit 12 receives the coefficients of the simultaneous polynomial calculated by the coefficient calculating unit 11, solves the simultaneous polynomial, and outputs all the solutions.
  • the position / orientation calculation unit 2 is a processing unit that receives the solution of simultaneous polynomials calculated by the optimal solution candidate calculation unit 1 and calculates and outputs a position / orientation that minimizes the error function.
  • the position / orientation calculation unit 2 includes a real number solution extraction unit 21, a posture candidate calculation unit 22, a posture candidate number totaling unit 23, an input score totaling unit 24, a minimum error candidate extraction unit 25, and a position candidate calculation unit 26. including.
  • the position / orientation calculation unit 2 outputs a no-solution flag if a position / orientation that minimizes the error function cannot be obtained.
  • the real number solution extraction unit 21 receives all the solutions of the simultaneous polynomials calculated by the optimum solution candidate calculation unit 1, extracts all the real number solutions from the solutions, and outputs them. If no real number solution can be extracted, the real number solution extraction unit 21 stops the subsequent processing and outputs a no solution flag.
  • the posture candidate calculation unit 22 receives all real solutions extracted by the real number solution extraction unit 21 as input, and calculates and outputs posture candidates.
  • the posture candidate calculation unit 22 performs a process of converting each real solution into a value that is treated as representing one posture candidate in the subsequent calculations.
  • the posture candidate number counting unit 23 receives the posture candidates calculated by the posture candidate calculation unit 22, counts the number of posture candidates, and outputs the posture or the posture candidates according to the number of posture candidates.
  • the input point counting unit 24 receives the three-dimensional coordinates and the posture candidates, counts the number of the three-dimensional coordinates, and outputs the number of input points and the posture or posture candidates.
  • the input point counting unit 24 uses, for example, two-dimensional coordinates in order to count the number of input points.
  • the minimum error candidate extraction unit 25 receives a posture candidate as an input, calculates a posture that minimizes the error function, and outputs it.
  • the position candidate calculation unit 26 calculates a position corresponding to the posture when the posture is input, and outputs the position and posture.
  • the optimum solution candidate calculation unit 1 (more specifically, the coefficient calculation unit 11 and the simultaneous polynomial solution unit 12), the position and orientation calculation unit 2 (more specifically, the real number solution extraction unit 21, the orientation candidate).
  • the calculation unit 22, the number of posture candidates totaling unit 23, the number of input points totaling unit 24, the minimum error candidate extracting unit 25, and the position candidate calculating unit 26) are, for example, hardware or a program designed to perform specific arithmetic processing or the like It is realized by an information processing apparatus such as a CPU that operates according to the above.
  • FIG. 2 is a flowchart showing an example of the operation of the position / orientation estimation apparatus according to the present embodiment.
  • the coefficient calculation unit 11 uses the three-degree-of-freedom posture as a variable and the three-dimensional coordinates and the two-dimensional coordinates. Coefficients of simultaneous polynomials with the gradient of the error function representing the coordinate conversion relationship set to zero are calculated and output to the simultaneous polynomial solving unit 12 (step S11).
  • the degree of freedom of the camera posture is an index indicating how many variables each of the nine elements of the 3 ⁇ 3 matrix representing the posture of the camera are represented.
  • Limiting the degree of freedom to 3 indicates that the rows (or columns) of the matrix R representing the camera posture are orthogonal to each other, and the L2 norms of the rows (or columns) are equal to each other.
  • the simultaneous polynomial for which the coefficient calculation unit 11 calculates the coefficient is uniquely determined by how to express the degree of freedom of the camera posture in the error function.
  • a predetermined simultaneous system What is necessary is just to calculate the coefficient in a polynomial.
  • the coefficient calculation unit 11 predefines a plurality of simultaneous polynomial types corresponding to, for example, a method for expressing the degree of freedom of the camera posture, and uses the simultaneous polynomials that are used according to the values of the setting parameters read at the time of activation or the like. It is also possible to select the type.
  • the input coordinates are three or more different three-dimensional coordinates that are not in the camera position and degenerate arrangement, and two-dimensional coordinates corresponding to the three-dimensional coordinates. That is, the case where it is theoretically impossible to solve by the PnP problem is excluded on the input side. If the number of three-dimensional coordinates is different from the number of two-dimensional coordinates, the coefficient calculation unit 11 may return with an error without performing the subsequent operation on the assumption that there is no correspondence. Further, a coordinate set input unit (not shown) for inputting a set of 3D coordinates and 2D coordinates from the outside instead of the coefficient calculation unit 11 counts the number of input points, determines an error based on the number of each coordinate, and the like. It is also possible to perform.
  • the simultaneous polynomial solving unit 12 solves the simultaneous polynomial using the three-dimensional coordinates input in step S11 and the corresponding two-dimensional coordinates (step S12).
  • the simultaneous polynomial solving unit 12 outputs all solutions satisfying the simultaneous polynomial to the real number solution extracting unit 21.
  • the solution of the simultaneous polynomial here includes an inappropriate value as a posture. For example, some or all of them may be complex numbers.
  • the real solution extracting unit 21 extracts all the real solutions from them and outputs them to the posture candidate calculating unit 22 (step S13). Yes).
  • the real number solution extraction unit 21 outputs a “no solution” flag as the position and orientation estimation result and ends the operation (No in step S13).
  • Step S19 For example, if all the solutions are complex numbers, the real number solution extraction unit 21 outputs a “no solution” flag and ends the operation.
  • the “no solution” flag may be a true / false value, for example, or may output a position / orientation value indicating no solution determined in advance.
  • the posture candidate calculation unit 22 receives all real number solutions and calculates a posture candidate (step S14).
  • the posture candidates obtained as a result of the calculation are output to the posture candidate number counting unit 23.
  • the posture candidate calculation unit 22 may perform a process of converting the obtained real number solution into values (3 ⁇ 3 matrix representing the posture) each of which is a posture candidate.
  • the posture candidate count totaling unit 23 counts the number of input posture candidates, and the number of posture candidates as a counting result.
  • the subsequent processing is branched according to (step S15).
  • the posture candidate number counting unit 23 outputs the posture to the position candidate calculation unit 27 (proceeds to step S18). If there are a plurality of posture candidates, the posture candidate count totaling unit 23 outputs all input posture candidates to the input score totaling unit 24 (proceeds to step S16).
  • the input point totaling unit 24 When there are a plurality of posture candidates, the input point totaling unit 24, together with the plurality of posture candidates output by the posture candidate number totaling unit 23, the same three-dimensional coordinates as those input in step S11 or / And two-dimensional coordinates are input.
  • the input point totaling unit 24 counts the number of input three-dimensional coordinates or two-dimensional coordinates, and branches the subsequent processing according to the input point number that is the counting result (step S16).
  • the input point totaling unit 24 outputs all the input posture candidates and the input point number information to the position candidate calculating unit 27 (proceeds to step S18). This is because when the number of input points is 3, the error in all the posture candidates is 0, and it is impossible to determine which candidate is closest to the correct answer. On the other hand, when the number of input points is 4 or more, since the error in each candidate is different, it is possible to select only one candidate with the smallest error.
  • the posture candidates are output to the minimum error candidate extraction unit 25.
  • the input point information is information indicating the number of input points, and may be numerical information indicating the number of input points themselves or a flag indicating that there are three points.
  • all posture candidates are input to the minimum error candidate extraction unit 25 by the determination processing in step S16.
  • the minimum error candidate extraction unit 25 calculates one posture that minimizes the error function from all input posture candidates, and outputs the calculated one to the position candidate calculation unit 27 (step S17).
  • step S18 if the number of posture candidates is one by the determination processing in step S15, the posture candidate is input to the position candidate calculation unit 27 as the posture with the minimum error. Alternatively, if there are a plurality of posture candidates and the number of input points is three by the determination processing in step S16, all the posture candidates are input to the position candidate calculation unit 27 together with the input point number information as the posture of the minimum error. Alternatively, the one posture whose error function is minimized by the process of step S ⁇ b> 17 is input to the position candidate calculation unit 27. When one posture is input, the position candidate calculation unit 27 calculates a position corresponding to the posture and outputs the position and posture as an estimation result.
  • the position candidate calculation unit 27 converts the input plurality of posture candidates into postures, The position corresponding to the posture is calculated, and all the calculated positions and postures are output as the position and posture of the estimation result.
  • the superscript T is a transpose of a matrix and a vector
  • 0 is a zero matrix and a zero vector
  • I is a unit matrix
  • det is a determinant
  • is an L2 norm of a vector.
  • the input number is n points, relative to the i-th three-dimensional coordinates X i, Qi Tsugika the two-dimensional coordinates of v i, the camera posture matrix R, the camera position vector t, from t to v i vector c i the Do position, the proportional constant of v i represents the lambda i.
  • ⁇ i is eliminated by differentiation, but v i may be converted to a distortion symmetric matrix indicating the outer product of the vectors and erased by multiplying both sides of the above equation (1).
  • Equation (4) r is a vectorization of R. Further, when the optimum t is substituted into Expression (3), the error function is expressed by the following Expression (5) as a constrained nonlinear optimization problem.
  • M 1 , M 2 , and M 3 are represented by the following formula (6).
  • R is represented by the following formula (8).
  • the optimum solution of equation (5) can be obtained by multiplying the optimum solution of equation (7) by a constant.
  • Equation (7) is a non-constrained nonlinear optimization problem
  • the optimum solution is a solution of simultaneous polynomials with the gradient obtained by partial differentiation of Equation (7) by a, b, and c being zero.
  • order of z can be set to reverse lexicographic order with order, lexicographic order with order, lexicographic order, etc.
  • step S11 the coefficient calculation unit 11 has X i and v i (1 ⁇ i ⁇ n) as inputs, and a coefficient matrix of a simultaneous polynomial in which the gradient obtained by partial differentiation of equation (7) with a, b, and c is zero. N is calculated and output to the simultaneous polynomial solving unit 12.
  • the solution of simultaneous polynomials is, for example, to calculate the Gröbner basis according to the z term order.
  • a method for obtaining the Gröbner basis there are a Buchberger algorithm, an F4 algorithm, an XL algorithm, and the like. Further, since the term appearing in z does not change every calculation, the method of Kukelova et al. May be used without obtaining the Gröbner basis.
  • the method of Kukelova et al. Is a method for obtaining a term appearing in a Gröbner basis by pre-calculation, calculating Action Matrix that constitutes the Gröbner basis from the coefficient matrix N, and obtaining a solution by eigenvalue decomposition of the Action Matrix.
  • the no solution flag may be a true / false value, for example.
  • the real number solution extraction unit 21 may output a position / orientation value indicating no solution determined in advance.
  • step S14 the posture candidate calculation unit 22 receives all real number solutions, calculates posture candidates, and outputs the posture candidates to the posture candidate count totaling unit 23.
  • Posture candidates are given by the following equation (10).
  • Equation (10) represents a calculation method for all nine elements of the posture (3 ⁇ 3 matrix). For example, if there are k real number solutions, it means that there are k sets of [a, b, c], and the posture candidate calculation unit 22 sets one set of k sets of [a, b, c]. Substituting into Equation (10) one by one, k candidate candidates (3 ⁇ 3 matrix) may be obtained.
  • the posture candidate number counting unit 23 receives the calculated posture candidates as input and calculates the number of posture candidates. If the number of posture candidates is one, the posture candidates are converted into postures by Expression (11) and output to the position candidate calculator 26.
  • the posture candidate count totaling unit 23 outputs all the posture candidates to the input score totaling unit 24.
  • step S16 X i or v i (1 ⁇ i ⁇ n ) is input to the input number counting unit 24.
  • the input score totaling unit 24 converts the posture candidates into postures using the equation (11), and outputs all postures as conversion results to the position candidate calculation unit 26 together with n as input point number information. May be.
  • step S16 when n ⁇ 4, the input point totaling unit 24 outputs all posture candidates to the minimum error candidate extracting unit 25.
  • step S17 the minimum error candidate extraction unit 25 receives a plurality of posture candidates, vectorizes them and substitutes them into equation (7), and uses the posture candidate that minimizes equation (7) as a position candidate. It outputs to the calculation part 26.
  • step S18 one or a plurality of postures (or posture candidates) and the number of input points are input to the position candidate calculation unit 26.
  • the position candidate calculation unit 26 converts the posture into a posture by Expression (11), and then sets one set based on the input one posture or a plurality of postures and the number of input points. Calculates and outputs the position and orientation of multiple or multiple positions and orientations.
  • the position is calculated by equation (4).
  • the position / orientation calculation unit 2 first extracts all real solutions and narrows down candidates for the optimal solution from the real solutions by batch processing, but sequentially processes the solutions of simultaneous polynomials one by one. Is also possible. For example, every time the simultaneous polynomial solving unit 12 obtains one solution, the solution is output to the real number solution extracting unit 21. If the real solution extraction unit 21 determines that the solution is a real number, conversion processing to a posture candidate by the posture candidate calculation unit 22, input point determination processing by the input point totaling unit 24, and minimum error candidate determination by the minimum error candidate extraction unit 25 Processing is executed by loop processing.
  • the minimum error candidate extraction unit 25 stores, as the minimum error candidate determination process, a candidate with the minimum error each time, and every time a real solution is extracted, an error calculation, a minimum error comparison process, Overwriting processing of the minimum candidate and the minimum value may be performed.
  • the branching process based on the number of posture candidates and the number of input points may be collectively performed by the minimum error candidate extraction unit 25.
  • the branching process based on the number of posture candidates and the number of input points is not limited to sequential processing, and can be performed collectively by the minimum error candidate extraction unit 25. In such a case, the posture candidate calculation unit 22 and the input score totaling unit 24 can be omitted.
  • the minimum error candidate extraction unit 25 uses Expression (7) as an error function, but Expression (5) and reprojection error can also be used.
  • equation (5) the minimum error candidate extraction unit 25 converts all posture candidates into postures from equation (11) and substitutes them into equation (5).
  • the minimum error candidate extraction unit 25 first converts all posture candidates into postures from Equation (11).
  • the minimum error candidate extraction unit 25 calculates positions for all postures.
  • the minimum error candidate extraction unit 26 receives all postures and positions, and outputs a position and posture that minimizes the reprojection error.
  • the position and orientation of the camera or subject can be estimated with high accuracy and stability.
  • the reason is as follows. First, since the error function having the three-degree-of-freedom posture as a variable does not depend on the distribution of the three-dimensional coordinates or the number of input points, it is not necessary to apply a different position / posture calculation method. Moreover, since the nonlinear optimization method is not used, the calculation cost is low. Also, solving the simultaneous polynomial with the error function gradient being zero will calculate all the optimal solution candidates and extract the candidate with the smallest error function, so the output position and orientation is the global minimum solution This is because it is guaranteed.
  • the position and orientation estimation method according to the present embodiment is different from the conventional method in which one method is used to search for one value that seems to be close to the global optimal solution and nonlinear optimization is performed using the value as an initial value. To find all candidates for the minimum value of the error function, and select the candidate with the minimum error as the optimum value.
  • the solution of the simultaneous polynomial with the error function gradient being zero is called the stop point, and is a necessary condition for the error function to be minimized.
  • the stopping point is not a sufficient condition, it is necessary to narrow down the global optimum solution from all candidates as described above.
  • nonlinear optimization is used as in a general method, a value that makes the simultaneous polynomial zero is searched for from an initial value that does not become zero even if it is substituted into the simultaneous polynomial. Then, since only one solution of the simultaneous polynomial is searched, there is no guarantee that the searched solution is a global optimal solution. Further, in the method of searching for a solution by optimization, it is difficult to discriminate between a local optimum solution and a global optimum solution.
  • Non-Patent Document 1 a solution can be obtained by a very simple calculation method by ignoring the degree of freedom of the posture. A value with poor accuracy is obtained by comparison. For this reason, it is necessary to perform nonlinear optimization so that the degree of freedom 3 is satisfied by using the method described in Non-Patent Document 3.
  • all candidates that can be the optimum value can be obtained without performing optimization. That is, a method is adopted in which all values that have the possibility of a global optimal solution are calculated and then narrowed down. Therefore, the position and orientation of the camera or subject can be estimated with high accuracy and stability.
  • FIG. 3 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the second embodiment of the present invention.
  • the position / orientation estimation apparatus according to this embodiment is different from the first embodiment shown in FIG. 1 in that the position / orientation calculation unit 2 further includes a secondary optimality verification unit 31.
  • the second-order optimality verification unit 31 receives the real number solution output from the real number solution extraction unit 21 as input, verifies the positive definiteness of the Hessian matrix obtained by second-order differentiation of the error function with a variable, and calculates a real number solution that is a positive definite value The solution is output to the optimal posture candidate unit 23 as a solution satisfying the second-order optimality sufficient condition.
  • the secondary optimality verification unit 31 aborts the subsequent processing and outputs a no solution flag.
  • the secondary optimality verification unit 31 is realized by, for example, hardware designed to perform specific arithmetic processing or the like, or an information processing apparatus such as a CPU that operates according to a program.
  • FIG. 4 is a flowchart showing an example of the operation of the position / orientation estimation apparatus of this embodiment. Since the operations other than step S21 are the same as those in the first embodiment, description thereof will be omitted.
  • the quadratic optimality verification unit 31 verifies the positive definiteness of the Hessian matrix obtained by second-order differentiation of the error function with respect to the real solution of the simultaneous polynomial extracted by the real number solution extraction unit 21, and is a positive definite value.
  • the real number solution is output to the optimal posture candidate unit 23 as a solution that satisfies the secondary optimality sufficient condition (step S21).
  • the secondary optimality verification unit 31 outputs a no-solution flag and ends the operation (No in step S21, step S19).
  • the no solution flag may be a true / false value, for example.
  • the secondary optimality verification unit 31 may output posture and position values representing no solution determined in advance.
  • the secondary optimality verification unit 31 receives the real number solution output from the real number solution extraction unit 21, and substitutes the real number solution into the Hessian matrix obtained by second-order differentiation of equation (7) by [a, b, c]. If the Hessian matrix is a positive definite value, the secondary optimality verification unit 31 outputs a solution satisfying the secondary optimality sufficient condition to the posture candidate calculation unit 23 (Yes in step S21). When there is no positive definite Hessian matrix, the secondary optimality verification unit 31 outputs a no-solution flag in the same manner as the real solution extraction unit 21, and ends (No in step S21).
  • the second-order optimality verification unit 31 may verify, for example, whether all the minor determinants of the Hessian matrix are greater than zero, or the eigenvalue of the Hessian matrix may be It may be verified whether all are greater than zero.
  • the position and orientation of the camera or subject can be estimated at higher speed. Further, the reliability of the position and orientation output as the estimation result can be further improved. This is because the second-order optimality verification unit 31 eliminates inappropriate solutions that satisfy the simultaneous polynomials but are not locally optimal solutions, and reduce the number of posture candidates.
  • the real solution obtained by the secondary optimality verification unit 31 is always a local optimal solution. Therefore, it is guaranteed that the solution having the smallest error among them is a global optimum solution.
  • the calculation cost can be reduced by terminating the subsequent processing.
  • FIG. 5 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the third embodiment of the present invention.
  • this embodiment further includes a flatness verification unit 4.
  • the frontality verification unit 4 is a processing unit that receives the three-dimensional coordinates, corrects the position and orientation so that the three-dimensional coordinates are in front of the camera, and outputs them.
  • the frontality verification unit 4 includes a plane determination unit 41 and a position / orientation correction unit 42.
  • the plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is planar or non-planar, and outputs a flag indicating whether the plane is non-planar.
  • the position / orientation correction unit 42 receives a flag indicating whether it is a plane or non-planar, a three-dimensional coordinate, and a position / orientation. If it is a plane, the position / orientation correction unit 42 determines whether the three-dimensional coordinate is in front of the camera. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation.
  • the frontality verification unit 4 determines that a posture in which three-dimensional coordinates do not exist in front of the camera is an inappropriate value as a posture even if the solution satisfying the simultaneous polynomial is a real number solution.
  • the position and orientation are corrected so that the dimensional coordinates are in front of the camera, and processing for removing the indefiniteness of the code is performed.
  • the frontality verification unit 4 (more specifically, the plane determination unit 41 and the position / orientation correction unit 42) operates in accordance with, for example, hardware or a program designed to perform specific arithmetic processing or the like. This is realized by an information processing device such as a CPU.
  • FIG. 6 is a flowchart illustrating an example of the operation of the position / orientation estimation apparatus according to this embodiment.
  • the operations other than Step S31 and Step S32 are the same as those in the second embodiment, and thus the description thereof is omitted.
  • the plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is plane or non-plane, and outputs a flag indicating whether the plane is non-plane (step S31).
  • the position / orientation correction unit 42 receives as input the three-dimensional coordinates input in step S11, the flag indicating whether the plane or non-plane is output from the plane determination unit 41, and the position / orientation output from the position candidate calculation unit 27. If the flag indicates a plane (Yes in step S31), it is determined whether or not the three-dimensional coordinates are in front of the camera. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects the position / orientation and outputs the position / orientation as an estimation result (step S32). In the case of a non-planar surface, the position / orientation correction unit 42 outputs the input position / orientation as it is as the position / orientation of the estimation result.
  • the plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is plane or non-plane, and outputs a flag indicating whether the plane is non-plane (step S31).
  • the plane determination unit 41 may calculate the absolute value of the sum of the sign functions of all the Z coordinates, for example. Alternatively, the determination may be made based on whether the determinant of the moment matrix of the three-dimensional coordinates is close to zero.
  • the sign function is a function that returns +1 if the input value is positive, -1 if it is negative, and 0 if it is 0.
  • the plane discriminating unit 41 sets the plane having the Z coordinate of 0 if the absolute value of the sum of the sign functions of all the Z coordinates is equal to or less than the threshold value.
  • the threshold is determined as 80% of the number of input points.
  • the plane discriminating unit 41 discriminates whether the plane is a zero plane or a non-plane depending on whether the determinant of the moment matrix is close to zero.
  • the position / orientation correction unit 42 receives a plane / non-planar flag, a three-dimensional coordinate, and a position / orientation.
  • the plane flag is input (Yes in step S31)
  • whether the three-dimensional coordinate is in front of the camera. Determine. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation (step S32).
  • the position / orientation correction unit 42 When the non-planar flag is input (No in step S31), the position / orientation correction unit 42 outputs the input position / orientation as it is. Note that the position / orientation correction unit 42 counts the number of three-dimensional coordinates existing in front of the camera when a plane flag having a Z coordinate of 0 is input. If it is determined that the input three-dimensional coordinate group is not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation. As the flag, for example, a true / false value may be used, or a value or symbol representing a plane determined in advance may be used.
  • the position / orientation correction unit 42 uses, for example, a sign function in order to count the number of three-dimensional coordinates existing on the front surface of the camera. If the k-th row of R is r k with a bar and sgn is a sign function, the number of three-dimensional coordinates existing on the front surface of the camera is expressed by Expression (13).
  • the position / orientation correction unit 42 determines that the camera is inverted if Expression (13) is equal to or less than the threshold value.
  • the threshold is determined as 80% of the number of input points.
  • the plane discriminating unit 41 outputs a position and orientation that are geometrically consistent by correcting the position and orientation so that the three-dimensional coordinates are always in front of the camera.
  • the frontality verification unit 4 accepts a flag indicating the distribution of the three-dimensional coordinates as an input, omits the processing when the distribution is non-planar, and the distribution is flat or the distribution is unknown. It is also possible to perform processing in some cases.
  • the position / orientation correcting unit 42 determines whether or not to output without performing the correcting operation, and outputs It is also possible to output the position / orientation as the estimation result only when it is determined that it is acceptable. For example, the position / orientation correction unit 42 counts the number of three-dimensional coordinates existing on the front surface of the camera based on the equation (13), and if the number is equal to or greater than the threshold, the input three-dimensional coordinate group is the front surface of the camera. The position / orientation input as the estimation result is output as it is.
  • the position / orientation correction unit 42 determines that the input three-dimensional coordinate group is not in front of the camera, and does not output the position / orientation input as an estimation result, but generates an error. May be output.
  • the position / orientation correction unit 42 receives the three-dimensional coordinates and counts the number of the three-dimensional coordinates existing on the front surface of the camera using the sign function, so that the input three-dimensional coordinate group becomes the camera.
  • the method for determining whether or not it is in front of the camera has been shown, it is possible to determine whether or not the input three-dimensional coordinate group is in front of the camera by using two-dimensional coordinates as input. It is also possible to determine.
  • the position / orientation correction unit 42 uses the following equation (14) instead of equation (13) to calculate as follows.
  • the position / orientation correction unit 42 indicates that the input three-dimensional coordinate group exists in front of the camera if the above expression (14) is positive, and does not exist in front of the camera if it is negative (that is, the camera It may be determined that it exists on the back side.
  • FIG. 7 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the fourth embodiment of the present invention.
  • the present embodiment further includes a normalization unit 51 and a denormalization unit 52 in addition to the third embodiment.
  • the normalization unit 51 receives the three-dimensional coordinates and normalizes the three-dimensional coordinates based on the normalization parameters determined in advance or the normalization parameters calculated from the three-dimensional coordinates. Then, the normalization unit 51 outputs normalized three-dimensional coordinates and normalization parameters.
  • the denormalization unit 52 receives the normalization parameter and the position and orientation, denormalizes the position and orientation, and outputs the result.
  • the normalization unit 51 and the denormalization unit 52 are realized by, for example, hardware designed to perform specific arithmetic processing or the like, or an information processing device such as a CPU that operates according to a program.
  • FIG. 8 is a flowchart showing an example of the operation of the position / orientation estimation apparatus of this embodiment.
  • operations other than step S41 and step S42 are the same as those in the third embodiment, and thus the description thereof is omitted.
  • the normalization unit 51 first receives the three-dimensional coordinates, and normalizes the three-dimensional coordinates based on the normalization parameters determined in advance or the normalization parameters calculated from the three-dimensional coordinates (step S41). Then, the normalization unit 51 outputs the normalized three-dimensional coordinates to the coefficient calculation unit 11 and outputs the normalization parameters to the inverse normalization unit 42.
  • the denormalization unit 52 receives the normalization parameter output from the normalization unit 51 and the position and orientation output from the position candidate calculation unit 27, denormalizes the position and orientation, and outputs the result (step S42). .
  • the range of the two-dimensional coordinates is often normalized to an appropriate value such as [ ⁇ 1, +1], so that it is not necessary to normalize.
  • the range of the three-dimensional coordinate is, for example, hundreds or thousands if the unit is millimeters, which causes numerical instability such as overflowing in the middle of calculation.
  • the normalization unit 51 normalizes the three-dimensional coordinates and matches the range with the two-dimensional coordinates to improve numerical stability.
  • the translation vector p may be, for example, the center of gravity of the three-dimensional coordinate or the median value.
  • the scale s may be, for example, a standard deviation of three-dimensional coordinates or a maximum value of three-dimensional coordinates.
  • the normalization unit 51 receives the three-dimensional coordinates as input, calculates a predetermined normalization parameter or normalization parameter, and normalizes the three-dimensional coordinates. Then, the normalization unit 51 outputs the normalized three-dimensional coordinates and normalization parameters (Step S41).
  • Three-dimensional coordinates obtained by normalizing is s (X i -p). Normalization parameters are p and s.
  • the denormalization unit 52 receives the normalization parameter and the position and orientation, denormalizes the position and orientation, and outputs the result (step S413). In this embodiment, since the posture is not affected by normalization, it is output as it is. The position is denormalized to (1 / s) t-Rp and output.
  • the position and orientation of the camera or subject can be estimated with higher accuracy.
  • the reason for this is that normalizing the three-dimensional coordinates reduces the order of values in the middle of calculation and improves numerical stability.
  • FIG. 9 is a block diagram when the position / orientation estimation apparatus according to the present invention is implemented in an information processing system.
  • the information processing system shown in FIG. 9 is a general information processing system including a processor 61, a program memory 62, and a storage medium 63.
  • the storage medium 63 may be a storage area composed of separate storage media, or may be a storage area composed of the same storage medium.
  • a magnetic storage medium such as a RAM or a hard disk can be used.
  • the program memory 61 includes the above-described optimal solution candidate calculation unit 1 (more specifically, the coefficient calculation unit 11 and the simultaneous polynomial solution unit 12) and the optimal position / orientation candidate calculation unit 2 (more specifically, a real number).
  • the frontality verification unit 4 (more specifically, the plane discriminating unit 41 and the position / orientation correction unit 42), the normalization unit 51, and the denormalization unit 52 are processed by the processor 61. Is stored, and the processor 61 operates in accordance with this program.
  • the processor 61 may be a processor that operates according to a program such as a CPU, for example.
  • the present invention can be realized by a computer program. Note that it is not necessary to operate all the parts that can be operated by the program by the program, and a part may be configured by hardware. Moreover, you may implement
  • FIG. 10 is a block diagram showing an outline of the present invention.
  • the position / orientation estimation apparatus shown in FIG. 9 is an apparatus that receives a set of three or more three-dimensional coordinates related to an object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image, and includes an optimal solution candidate calculation unit 101. And position / orientation calculation means 102.
  • the optimum solution candidate calculation means 101 uses a set of the input 3D coordinates and 2D coordinates and uses a set of 3 degrees of freedom as a variable for a predetermined error function representing the conversion relationship between the 3D coordinates and the 2D coordinates. Thus, all solutions satisfying the simultaneous polynomial with the error function gradient set to zero are calculated.
  • the optimal solution candidate calculation unit 101 is shown as the optimal solution candidate calculation unit 1, for example.
  • the position / orientation calculation means 102 extracts the optimal solution that minimizes the error function from all the solutions of the simultaneous polynomials calculated by the optimal solution candidate calculation means 101, and images the object based on the extracted optimal solution. Calculate the camera's position and orientation.
  • the position / orientation calculation means 102 is shown as, for example, the position / orientation calculation unit 2 in the above embodiment.
  • the optimal solution candidate calculation means 101 receives a set of three-dimensional coordinates and two-dimensional coordinates as input, coefficient calculation means for calculating coefficients of simultaneous polynomials, and coefficients of simultaneous polynomials calculated by the coefficient calculation means as inputs, Simultaneous polynomial solving means for calculating all solutions satisfying the simultaneous polynomials may be included.
  • the position / orientation calculation means 102 extracts all real solutions from all solutions of the simultaneous polynomials, and outputs a real number solution extraction means for outputting a flag indicating all the extracted real solutions or no solutions, and real number solution extraction Posture candidate calculation means for converting all real solutions extracted by the means into one posture candidate, the number of posture candidates converted by the posture candidate calculation means, the input three-dimensional coordinates and two-dimensional A minimum error candidate extraction unit that extracts one or a plurality of postures having a minimum error function from all the posture candidates converted by the posture candidate calculation unit based on the number of input points that is the number of sets of coordinates; The position corresponding to each posture is calculated based on one or a plurality of postures in which the error function extracted by the minimum error candidate extracting means is minimized, and each position is output as a set of positions and postures.
  • a position candidate calculation unit that may contain. Note that the conversion processing by the posture candidate calculation means and the extraction processing by the minimum error candidate extraction means are not only performed in batch after all the real number solutions and posture candidates to be processed are input, but also the data to be processed It is also possible to process sequentially according to the input method.
  • the position / orientation calculation means 102 includes secondary optimality verification means for calculating and outputting real solutions satisfying the secondary optimality sufficient condition among all real number solutions extracted by the real number solution extraction means,
  • the posture candidate calculation unit may convert all the real solutions that are determined to satisfy the secondary optimality sufficient condition by the secondary optimality verification unit into one posture candidate.
  • the position / orientation estimation apparatus determines whether or not the input three-dimensional coordinates are in front of the camera.
  • Frontality verification means for correcting the position and orientation output from the calculation means or outputting a flag indicating an error may be provided.
  • the frontality verification means determines whether the three-dimensional coordinates are planar or non-planar, outputs a determination result, the three-dimensional coordinates, the determination result, and the position and orientation output from the position and orientation calculation means If the determination result is a plane, it is determined whether or not the three-dimensional coordinate is in front of the camera. May be included.
  • the position / orientation estimation apparatus receives a set of three-dimensional coordinates and two-dimensional coordinates, when a normalization parameter or a three-dimensional parameter determined in advance is input to the position / orientation estimation apparatus. Based on the normalization parameter calculated by the coordinates, the normalization means for normalizing the three-dimensional coordinates, the normalization parameters, and the position and orientation calculated using the normalized three-dimensional coordinates are input, and the normalization parameters And a denormalization unit that calculates and outputs a position and orientation that have been denormalized based on the above. In such a case, the optimal solution candidate calculation unit 101 calculates all solutions satisfying the simultaneous polynomials using the three-dimensional coordinates normalized by the normalization unit.
  • the position / orientation calculation means 102 described above receives the real number solution extraction means for outputting a flag indicating all real solutions or no solution from the simultaneous polynomial solution, and the extracted real number solution as inputs, and calculates the attitude candidates.
  • Posture candidate calculation means, posture candidate number input means for calculating the number of posture candidates, input three-dimensional coordinates or two-dimensional coordinates, and posture candidates are input and input.
  • Input point totaling means for calculating the number of three-dimensional coordinates or two-dimensional coordinates, and outputting a plurality of postures for which the error function is minimized, based on the number of input points, or a posture candidate for which the minimum error is to be calculated;
  • the candidate for the posture to be calculated as the minimum error is input, the one posture that minimizes the error function is calculated and output, and the one or more postures that minimize the error function are input.
  • the positions corresponding to the force posture calculated and may be configured to include a position candidate calculation unit for outputting.
  • the present invention can be suitably applied to a use for estimating the position and orientation of the camera or subject.

Abstract

A position/posture estimation device is provided with: an optimum solution candidate calculation means (101) which, with three or more object-related pairs of three-dimensional coordinates and two-dimensional coordinates corresponding to the three-dimensional coordinates on an image as inputs, and with respect to a predetermined error function that indicates the transform relationship between the three-dimensional coordinates and the two-dimensional coordinates with a posture having three degrees of freedom as a variable, calculates all solutions that satisfy a simultaneous polynomial in which the gradient of the error function is zero, using the inputted pairs of the three-dimensional coordinates and the two-dimensional coordinates; and a position/posture calculation means (102) which extracts an optimum solution in which the error function becomes minimum from all the solutions of the simultaneous polynomial calculated by the optimum solution candidate calculation means (101), and on the basis of the extracted optimum solution, calculates the position/posture of a camera which has captured an image of the object.

Description

位置姿勢推定装置、位置姿勢推定方法および位置姿勢推定プログラムPosition / orientation estimation apparatus, position / orientation estimation method, and position / orientation estimation program
 本発明は、カメラまたは被写体の位置および姿勢(以下、これらを纏めて「位置姿勢」という。)を推定する位置姿勢推定装置、位置姿勢推定方法および位置姿勢推定プログラムに関する。 The present invention relates to a position / orientation estimation apparatus, a position / orientation estimation method, and a position / orientation estimation program for estimating the position and orientation of a camera or a subject (hereinafter collectively referred to as “position and orientation”).
 カメラで撮影した画像にコンピュータグラフィックスを違和感がないように自然に合成したり、カメラで撮影した画像から被写体や周囲環境の3次元形状を復元するには、カメラの位置姿勢または被写体の位置姿勢を高精度に推定することが必要である。ここで、静止した被写体の周りを動くカメラの位置姿勢を推定することと、静止したカメラの前で動く被写体の位置姿勢を推定することとは等価な問題であるため、以下、説明を簡単にするために、前者の場合を例にして説明する。 To synthesize computer graphics naturally with images taken with the camera, or to restore the 3D shape of the subject and the surrounding environment from the images taken with the camera, the camera position or posture of the subject Must be estimated with high accuracy. Here, estimating the position and orientation of a camera that moves around a stationary subject and estimating the position and orientation of a subject that moves in front of a stationary camera are equivalent problems. Therefore, the former case will be described as an example.
 カメラの内部パラメータが既知の場合に、カメラの位置姿勢を推定する方法の1つとして、複数の点に対する既知の3次元座標と画像上でこれら3次元座標に対応する2次元座標とを入力としてカメラの位置姿勢を求める方法がある。その方法はPnP(Perspective n Points)問題と呼ばれ、最少3点の入力からカメラの位置姿勢を求められる。しかし、3点から求めた解は一般に複数解が得られることが知られている。そこで、4点以上を用いて唯一解を算出する方法が提案されている。 As one method of estimating the position and orientation of the camera when the internal parameters of the camera are known, the known 3D coordinates for a plurality of points and the 2D coordinates corresponding to these 3D coordinates on the image are input. There is a method for obtaining the position and orientation of the camera. This method is called a PnP (Perspective n Points) problem, and the position and orientation of the camera can be obtained from a minimum of three input points. However, it is known that a plurality of solutions can be obtained from three points. Thus, a unique method for calculating a solution using four or more points has been proposed.
 例えば、非特許文献1には、DLT(Direct Linear Transform)法を用いて位置姿勢を推定する方法が記載されている。非特許文献1に記載された方法は、姿勢の回転行列に関する拘束条件を無視し、姿勢の各変数を独立に扱うことで非線形な再投影誤差を線形な代数的誤差へと変換する。そして、その方法は、係数行列の絶対値最小固有値に対応する固有ベクトルとして位置姿勢を求め、姿勢の拘束条件を満たすように事後補正を行う。再投影誤差は、推定した位置姿勢に基づいて3次元座標を画像へ射影した2次元座標と、入力である2次元座標とのユークリッド距離である。なお、3次元座標の分布が平面の場合は4点以上を用いる平面DLT法が利用される。一方、非平面の場合は6点以上を用いる非平面DLT法が利用される。 For example, Non-Patent Document 1 describes a method for estimating a position and orientation using a DLT (Direct Linear Transform) method. The method described in Non-Patent Document 1 ignores the constraint condition relating to the posture rotation matrix and treats each posture variable independently to convert a non-linear reprojection error into a linear algebraic error. In this method, the position and orientation is obtained as an eigenvector corresponding to the absolute minimum eigenvalue of the coefficient matrix, and post-correction is performed so as to satisfy the constraint condition of the orientation. The reprojection error is the Euclidean distance between the two-dimensional coordinates obtained by projecting the three-dimensional coordinates onto the image based on the estimated position and orientation and the input two-dimensional coordinates. When the distribution of the three-dimensional coordinates is a plane, the plane DLT method using four or more points is used. On the other hand, in the case of a non-planar surface, a non-planar DLT method using 6 points or more is used.
 また、例えば、非特許文献2には、カメラ位置から各点までの距離を推定し、距離から位置姿勢を推定する方法が記載されている。非特許文献2に記載された方法は、適当な1点の3次元座標の奥行きに関する4次式を複数定義する。そして、その方法は、4次式の各項を独立に扱って、係数行列を特異値分解した特異ベクトルから距離を推定する。距離からカメラ座標系における3次元座標が求まるため、入力である3次元座標とカメラ座標系における3次元座標から最小二乗法により位置姿勢が推定される。 Also, for example, Non-Patent Document 2 describes a method of estimating the distance from the camera position to each point and estimating the position and orientation from the distance. The method described in Non-Patent Document 2 defines a plurality of quaternary expressions related to the depth of an appropriate one-dimensional three-dimensional coordinate. Then, the method treats each term of the quartic equation independently, and estimates the distance from a singular vector obtained by singular value decomposition of the coefficient matrix. Since the three-dimensional coordinates in the camera coordinate system are obtained from the distance, the position and orientation are estimated by the least square method from the input three-dimensional coordinates and the three-dimensional coordinates in the camera coordinate system.
 しかし、非特許文献1や非特許文献2に記載されている方法は、変数間の拘束条件の一部または全部を無視して計算する。よって、得られる位置姿勢は、再投影誤差を最小化する大域的最適解ではない。 However, the methods described in Non-Patent Document 1 and Non-Patent Document 2 calculate by ignoring part or all of the constraint conditions between variables. Therefore, the obtained position and orientation is not a global optimum solution that minimizes the reprojection error.
 再投影誤差を最小化するための方法として、非特許文献3には、上記のような位置姿勢推定方法で得られた解を初期値として、バンドル調整法により再投影誤差が最小となるように最適化する方法が記載されている。バンドル調整法は、再投影誤差の2乗和が最小となるように、位置姿勢の非線形最適化を行う方法である。非線形最適化法としては、ニュートン法やレーベンバーグ・マーカード法などが用いられる。 As a method for minimizing the reprojection error, Non-Patent Document 3 describes that the solution obtained by the position and orientation estimation method as described above is used as an initial value so that the reprojection error is minimized by the bundle adjustment method. A method of optimization is described. The bundle adjustment method is a method of performing nonlinear optimization of the position and orientation so that the sum of squares of the reprojection error is minimized. As the nonlinear optimization method, Newton method, Levenberg-Marquardt method or the like is used.
 非特許文献1に記載されている位置姿勢推定方法は、3次元座標の分布や入力点数に応じて計算方法を変える必要があるので、位置姿勢の推定精度が下がる可能性があるという問題があった。例えば、6点以上で3次元座標の分布が平面に近い場合は、非平面DLT法ではなく平面DLT法を用いた方が高精度な場合がある。 Since the position / orientation estimation method described in Non-Patent Document 1 needs to change the calculation method according to the distribution of three-dimensional coordinates and the number of input points, there is a problem that the estimation accuracy of the position / orientation may be lowered. It was. For example, when the distribution of three-dimensional coordinates is close to a plane with 6 points or more, it may be more accurate to use the planar DLT method instead of the non-planar DLT method.
 また、非特許文献2に記載されている位置姿勢推定方法は、3次元座標の分布には依存しないが、入力点数を増やすと数値計算が不安定になるので、位置姿勢の推定精度が下がるという問題があった。さらに、入力点数を増やした場合、推定に対する計算コストが大きくなるという問題がある。 The position / orientation estimation method described in Non-Patent Document 2 does not depend on the distribution of the three-dimensional coordinates, but the numerical calculation becomes unstable when the number of input points is increased, so that the position / orientation estimation accuracy decreases. There was a problem. Furthermore, when the number of input points is increased, there is a problem that the calculation cost for estimation increases.
 また、非特許文献3に記載されている方法を利用して、非特許文献1、2に記載された方法等により得た解を初期値としてバンドル調整法を行う場合、初期値が大域的最適解に十分近くないと局所最適解に収束または発散するという問題がある。さらに、非線形最適化法では反復して線形方程式を解く必要があり、計算コストが大きいという問題がある。 In addition, when the bundle adjustment method is performed using the method described in Non-Patent Document 3 and the solution obtained by the method described in Non-Patent Documents 1 and 2 as an initial value, the initial value is a global optimum. If it is not close enough to the solution, there is a problem that it converges or diverges to the local optimal solution. Furthermore, in the nonlinear optimization method, it is necessary to solve the linear equation repeatedly, and there is a problem that the calculation cost is high.
 すなわち、上記のいずれの方法を用いた場合でも、高精度かつ安定的にカメラまたは被写体の位置姿勢を推定することは困難である。 That is, it is difficult to estimate the position and orientation of the camera or subject with high accuracy and stability even when any of the above methods is used.
 そこで、本発明は、高精度かつ安定的に、カメラまたは被写体の位置姿勢を推定することができる位置姿勢推定装置、位置姿勢推定方法および位置姿勢推定プログラムを提供することを目的とする。なお、「安定的に」とは、より具体的には、入力点数を増やしても(例えば、5点以上にしても)数値計算が不安定にならないことをいう。また、入力点数を増やしても計算コストが所定の範囲を越えないことをいう。 Therefore, an object of the present invention is to provide a position / orientation estimation apparatus, a position / orientation estimation method, and a position / orientation estimation program capable of estimating the position and orientation of a camera or a subject with high accuracy and stability. More specifically, “stable” means that numerical calculation does not become unstable even if the number of input points is increased (for example, 5 points or more). Also, the calculation cost does not exceed a predetermined range even if the number of input points is increased.
 本発明による位置姿勢推定装置は、対象物に関する3以上の3次元座標と画像上で3次元座標に対応する2次元座標の組を入力とし、入力された3次元座標と2次元座標の組を用いて、3自由度の姿勢を変数として3次元座標と2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算する最適解候補計算手段と、最適解候補計算手段によって算出された連立多項式のすべての解の中から、誤差関数が最小となる最適解を抽出し、抽出した最適解に基づき対象物を撮影したカメラの位置姿勢を計算する位置姿勢計算手段とを備えたことを特徴とする。 The position / orientation estimation apparatus according to the present invention receives a set of three or more three-dimensional coordinates related to an object and a two-dimensional coordinate corresponding to the three-dimensional coordinate on the image, and inputs the set of the input three-dimensional coordinate and the two-dimensional coordinate. Using the attitude of 3 degrees of freedom as a variable, all solutions satisfying the simultaneous polynomial with the gradient of the error function as zero are calculated for a predetermined error function representing the conversion relationship between the 3D coordinates and the 2D coordinates. Optimal solution candidate calculation means and a camera that has captured the object based on the extracted optimal solution, extracting the optimal solution with the smallest error function from all the solutions of simultaneous polynomials calculated by the optimal solution candidate calculation means And a position / orientation calculating means for calculating the position / orientation.
 また、本発明による位置姿勢推定方法は、対象物に関する3以上の3次元座標と画像上で3次元座標に対応する2次元座標の組を入力として、入力された3次元座標と2次元座標の組を用いて、3自由度の姿勢を変数として3次元座標と2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算し、算出された連立多項式のすべての解の中から、誤差関数が最小となる最適解を抽出し、抽出した最適解に基づき対象物を撮影したカメラの位置姿勢を計算することを特徴とする。 Also, the position and orientation estimation method according to the present invention receives a set of three or more three-dimensional coordinates related to an object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image, and inputs the inputted three-dimensional coordinates and two-dimensional coordinates. Using a set of three degrees of freedom as a variable, all solutions satisfying a simultaneous polynomial with the gradient of the error function as zero for a given error function representing the conversion relationship between 3D coordinates and 2D coordinates are expressed. Calculating and extracting the optimal solution that minimizes the error function from all the calculated simultaneous polynomial solutions, and calculating the position and orientation of the camera that captured the object based on the extracted optimal solution To do.
 また、本発明による位置姿勢推定プログラムは、コンピュータに、入力された対象物に関する3以上の3次元座標と画像上で3次元座標に対応する2次元座標の組を用いて、3自由度の姿勢を変数として3次元座標と2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算する処理、および算出された連立多項式のすべての解の中から、誤差関数が最小となる最適解を抽出し、抽出した最適解に基づき対象物を撮影したカメラの位置姿勢を計算する処理を実行させることを特徴とする。 Further, the position / orientation estimation program according to the present invention uses a set of three or more three-dimensional coordinates relating to an input object and a two-dimensional coordinate corresponding to the three-dimensional coordinates on the image to the computer. Processing for calculating all solutions satisfying the simultaneous polynomial with the gradient of the error function as zero, for a predetermined error function representing the conversion relationship between the three-dimensional coordinates and the two-dimensional coordinates, using as a variable, and the calculated simultaneous polynomial An optimal solution that minimizes the error function is extracted from all the solutions, and a process for calculating the position and orientation of the camera that captured the object is executed based on the extracted optimal solution.
 本発明によれば、高精度かつ安定的に、カメラまたは被写体の位置姿勢を推定することができる。 According to the present invention, the position and orientation of the camera or subject can be estimated with high accuracy and stability.
第1の実施形態の位置姿勢推定装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the position and orientation estimation apparatus of 1st Embodiment. 第1の実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the position and orientation estimation apparatus of 1st Embodiment. 第2の実施形態の位置姿勢推定装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the position and orientation estimation apparatus of 2nd Embodiment. 第2の実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the position and orientation estimation apparatus of 2nd Embodiment. 第3の実施形態の位置姿勢推定装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the position and orientation estimation apparatus of 3rd Embodiment. 第3の実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the position and orientation estimation apparatus of 3rd Embodiment. 第4の実施形態の位置姿勢推定装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the position and orientation estimation apparatus of 4th Embodiment. 第4の実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the position and orientation estimation apparatus of 4th Embodiment. 本発明を情報処理システムに適用した場合のブロック図である。It is a block diagram at the time of applying this invention to an information processing system. 本発明の概要を示すブロック図である。It is a block diagram which shows the outline | summary of this invention.
 以下、本発明の実施形態を図面を参照して説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
実施形態1.
 図1は、本発明の第1の実施形態の位置姿勢推定装置の構成例を示すブロック図である。図1に示す位置姿勢推定装置は、最適解候補計算部1と、位置姿勢計算部2とを備える。
Embodiment 1. FIG.
FIG. 1 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the first embodiment of the present invention. The position / orientation estimation apparatus shown in FIG. 1 includes an optimal solution candidate calculation unit 1 and a position / orientation calculation unit 2.
 最適解候補計算部1は、3点以上の3次元座標と該3次元座標に対応する2次元座標を入力とし、3自由度のカメラの姿勢を変数として、3次元座標と2次元座標の変換関係を表す誤差関数の勾配をゼロとした連立多項式(以下、単に連立多項式という。)の解を出力する処理部であって、本例では係数計算部11と、連立多項式求解部12とを含む。 Optimal solution candidate calculation unit 1 receives three or more three-dimensional coordinates and two-dimensional coordinates corresponding to the three-dimensional coordinates as input, and converts the three-degree-of-freedom camera posture as a variable to convert three-dimensional coordinates and two-dimensional coordinates. A processing unit that outputs a solution of a simultaneous polynomial (hereinafter simply referred to as a simultaneous polynomial) in which the gradient of the error function representing the relationship is zero, and includes a coefficient calculation unit 11 and a simultaneous polynomial solution unit 12 in this example. .
 係数計算部11は、3次元座標と2次元座標とを入力とし、連立多項式の係数を計算し、連立多項式求解部12に出力する。 The coefficient calculation unit 11 receives the three-dimensional coordinates and the two-dimensional coordinates as input, calculates the coefficients of the simultaneous polynomial, and outputs them to the simultaneous polynomial solving unit 12.
 連立多項式求解部12は、係数計算部11によって算出された連立多項式の係数を入力とし、連立多項式を解き、すべての解を出力する。 The simultaneous polynomial solving unit 12 receives the coefficients of the simultaneous polynomial calculated by the coefficient calculating unit 11, solves the simultaneous polynomial, and outputs all the solutions.
 位置姿勢計算部2は、最適解候補計算部1によって算出された連立多項式の解を入力とし、誤差関数を最小化する位置姿勢を計算して、出力する処理部である。位置姿勢計算部2は、実数解抽出部21と、姿勢候補計算部22と、姿勢候補数集計部23と、入力点数集計部24と、誤差最小候補抽出部25と、位置候補計算部26とを含む。また、位置姿勢計算部2は、誤差関数を最小化する位置姿勢が得られなければ、解なしのフラグを出力する。 The position / orientation calculation unit 2 is a processing unit that receives the solution of simultaneous polynomials calculated by the optimal solution candidate calculation unit 1 and calculates and outputs a position / orientation that minimizes the error function. The position / orientation calculation unit 2 includes a real number solution extraction unit 21, a posture candidate calculation unit 22, a posture candidate number totaling unit 23, an input score totaling unit 24, a minimum error candidate extraction unit 25, and a position candidate calculation unit 26. including. The position / orientation calculation unit 2 outputs a no-solution flag if a position / orientation that minimizes the error function cannot be obtained.
 実数解抽出部21は、最適解候補計算部1によって算出された連立多項式のすべての解を入力とし、その中からすべての実数解を抽出し、出力する。実数解抽出部21は、実数解が1つも抽出できない場合、以降の処理を打ち切って解なしのフラグを出力する。 The real number solution extraction unit 21 receives all the solutions of the simultaneous polynomials calculated by the optimum solution candidate calculation unit 1, extracts all the real number solutions from the solutions, and outputs them. If no real number solution can be extracted, the real number solution extraction unit 21 stops the subsequent processing and outputs a no solution flag.
 姿勢候補計算部22は、実数解抽出部21によって抽出されたすべての実数解を入力とし、姿勢の候補を計算して出力する。姿勢候補計算部22は、各実数解をそれぞれ、以降の計算において1つの姿勢の候補を表すものとして扱われる値に変換する処理を行う。 The posture candidate calculation unit 22 receives all real solutions extracted by the real number solution extraction unit 21 as input, and calculates and outputs posture candidates. The posture candidate calculation unit 22 performs a process of converting each real solution into a value that is treated as representing one posture candidate in the subsequent calculations.
 姿勢候補数集計部23は、姿勢候補計算部22によって算出された姿勢の候補を入力とし、姿勢の候補数を数え、姿勢の候補数に応じて、姿勢または姿勢の候補を出力する。 The posture candidate number counting unit 23 receives the posture candidates calculated by the posture candidate calculation unit 22, counts the number of posture candidates, and outputs the posture or the posture candidates according to the number of posture candidates.
 入力点数集計部24は、3次元座標と、姿勢の候補とを入力とし、3次元座標の数を数え、入力点数と姿勢または姿勢の候補とを出力する。入力点数集計部24は、入力点数を数えるために、例えば、2次元座標を用いる。 The input point counting unit 24 receives the three-dimensional coordinates and the posture candidates, counts the number of the three-dimensional coordinates, and outputs the number of input points and the posture or posture candidates. The input point counting unit 24 uses, for example, two-dimensional coordinates in order to count the number of input points.
 誤差最小候補抽出部25は、姿勢の候補を入力とし、誤差関数を最小化する姿勢を計算し、出力する。 The minimum error candidate extraction unit 25 receives a posture candidate as an input, calculates a posture that minimizes the error function, and outputs it.
 位置候補計算部26は、姿勢が入力された場合、姿勢に対応する位置を計算し、位置姿勢を出力する。位置候補計算部26は、姿勢の候補と入力点数が入力された場合、姿勢の候補を姿勢に変換し、それぞれの姿勢に対応する位置を計算し、すべての位置姿勢を出力する。 The position candidate calculation unit 26 calculates a position corresponding to the posture when the posture is input, and outputs the position and posture. The position candidate calculation unit 26, when a posture candidate and the number of input points are input, converts the posture candidate into a posture, calculates a position corresponding to each posture, and outputs all the positions and postures.
 本実施形態において、最適解候補計算部1(より具体的には、係数計算部11、連立多項式求解部12)、位置姿勢計算部2(より具体的には、実数解抽出部21、姿勢候補計算部22、姿勢候補数集計部23、入力点数集計部24、誤差最小候補抽出部25、位置候補計算部26)は、例えば、特定の演算処理等を行うよう設計されたハードウェア、またはプログラムに従って動作するCPU等の情報処理装置によって実現される。 In the present embodiment, the optimum solution candidate calculation unit 1 (more specifically, the coefficient calculation unit 11 and the simultaneous polynomial solution unit 12), the position and orientation calculation unit 2 (more specifically, the real number solution extraction unit 21, the orientation candidate). The calculation unit 22, the number of posture candidates totaling unit 23, the number of input points totaling unit 24, the minimum error candidate extracting unit 25, and the position candidate calculating unit 26) are, for example, hardware or a program designed to perform specific arithmetic processing or the like It is realized by an information processing apparatus such as a CPU that operates according to the above.
 次に、本実施形態の動作を図2を参照して説明する。図2は、本実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。 Next, the operation of this embodiment will be described with reference to FIG. FIG. 2 is a flowchart showing an example of the operation of the position / orientation estimation apparatus according to the present embodiment.
 図2に示す例では、まず、係数計算部11は、3次元座標と該3次元座標に対応する2次元座標が入力されると、3自由度の姿勢を変数として、3次元座標と2次元座標の変換関係を表す誤差関数の勾配をゼロとした連立多項式の係数を計算し、連立多項式求解部12に出力する(ステップS11)。ここで、カメラ姿勢の自由度は、カメラの姿勢を表す3×3行列の9個の要素がそれぞれ何個の変数で表現されているかを示す指標である。自由度を3に限定することは、カメラ姿勢を表す行列Rの各行(または各列)が互いに直交し、各行(または各列)のL2ノルムが互いに等しいことを表している。本実施形態において、係数計算部11が係数を算出する対象とする連立多項式は、誤差関数においてカメラ姿勢の自由度をどのように表現するかで一意に定まるため、係数計算部11は、例えば、予め定義付けられたカメラ姿勢の自由度の表現方法または連立多項式の型に従い、入力された3点以上の3次元座標と該3次元座標に対応する2次元座標の組を用いて、所定の連立多項式における係数を算出すればよい。また、係数計算部11は、例えば、カメラ姿勢の自由度の表現方法に応じた複数の連立多項式の型を予め定義づけておき、起動時等に読み出した設定パラメータの値に応じて用いる連立多項式の型を選択することも可能である。 In the example illustrated in FIG. 2, first, when the three-dimensional coordinates and the two-dimensional coordinates corresponding to the three-dimensional coordinates are input, the coefficient calculation unit 11 uses the three-degree-of-freedom posture as a variable and the three-dimensional coordinates and the two-dimensional coordinates. Coefficients of simultaneous polynomials with the gradient of the error function representing the coordinate conversion relationship set to zero are calculated and output to the simultaneous polynomial solving unit 12 (step S11). Here, the degree of freedom of the camera posture is an index indicating how many variables each of the nine elements of the 3 × 3 matrix representing the posture of the camera are represented. Limiting the degree of freedom to 3 indicates that the rows (or columns) of the matrix R representing the camera posture are orthogonal to each other, and the L2 norms of the rows (or columns) are equal to each other. In the present embodiment, the simultaneous polynomial for which the coefficient calculation unit 11 calculates the coefficient is uniquely determined by how to express the degree of freedom of the camera posture in the error function. In accordance with a method for expressing the degree of freedom of the camera posture or the type of simultaneous polynomials defined in advance, using a set of three or more input three-dimensional coordinates and two-dimensional coordinates corresponding to the three-dimensional coordinates, a predetermined simultaneous system What is necessary is just to calculate the coefficient in a polynomial. In addition, the coefficient calculation unit 11 predefines a plurality of simultaneous polynomial types corresponding to, for example, a method for expressing the degree of freedom of the camera posture, and uses the simultaneous polynomials that are used according to the values of the setting parameters read at the time of activation or the like. It is also possible to select the type.
 また、入力される座標は、カメラ位置と退化配置にない異なる3点以上の3次元座標と該3次元座標と対応する2次元座標であるとする。すなわち、PnP問題で解くことが理論的に不可能とされている場合が、入力側で除外される。なお、係数計算部11は、3次元座標と2次元座標の数が異なる場合は、対応関係にないものとして以降の動作を行わずにエラーを返して終了してもよい。また、係数計算部11の代わりに、3次元座標と2次元座標の組を外部より入力するための座標組入力部(図示せず)が、入力点数の計数や各座標の数によるエラー判定等を行うことも可能である。 Further, it is assumed that the input coordinates are three or more different three-dimensional coordinates that are not in the camera position and degenerate arrangement, and two-dimensional coordinates corresponding to the three-dimensional coordinates. That is, the case where it is theoretically impossible to solve by the PnP problem is excluded on the input side. If the number of three-dimensional coordinates is different from the number of two-dimensional coordinates, the coefficient calculation unit 11 may return with an error without performing the subsequent operation on the assumption that there is no correspondence. Further, a coordinate set input unit (not shown) for inputting a set of 3D coordinates and 2D coordinates from the outside instead of the coefficient calculation unit 11 counts the number of input points, determines an error based on the number of each coordinate, and the like. It is also possible to perform.
 次いで、連立多項式求解部12は、連立多項式の係数が入力されると、ステップS11で入力された3次元座標とそれに対応する2次元座標とを用いて連立多項式を解く(ステップS12)。また、連立多項式求解部12は、連立多項式を満たすすべての解を実数解抽出部21に出力する。ここでの連立多項式の解は、姿勢として不適切な値も含まれる。例えば、その一部またはすべてが複素数である場合がある。 Next, when the coefficients of the simultaneous polynomial are input, the simultaneous polynomial solving unit 12 solves the simultaneous polynomial using the three-dimensional coordinates input in step S11 and the corresponding two-dimensional coordinates (step S12). In addition, the simultaneous polynomial solving unit 12 outputs all solutions satisfying the simultaneous polynomial to the real number solution extracting unit 21. The solution of the simultaneous polynomial here includes an inappropriate value as a posture. For example, some or all of them may be complex numbers.
 実数解抽出部21は、連立多項式求解部12が解いた連立多項式のすべての解が入力されると、それらの中からすべての実数解を抽出して姿勢候補計算部22に出力する(ステップS13のYes)。連立多項式のすべての解から実数解が1つも抽出できない場合には、実数解抽出部21は、位置姿勢の推定結果として「解なし」のフラグを出力して動作を終了する(ステップS13のNo、ステップS19)。例えば、実数解抽出部21は、すべての解が複素数であれば「解なし」のフラグを出力し、動作を終了する。「解なし」のフラグは、例えば、真偽値であってもよいし、事前に決定した解なしを表す位置姿勢の値を出力してもよい。 When all the solutions of the simultaneous polynomials solved by the simultaneous polynomial solving unit 12 are input, the real solution extracting unit 21 extracts all the real solutions from them and outputs them to the posture candidate calculating unit 22 (step S13). Yes). When no real number solution can be extracted from all the solutions of the simultaneous polynomials, the real number solution extraction unit 21 outputs a “no solution” flag as the position and orientation estimation result and ends the operation (No in step S13). Step S19). For example, if all the solutions are complex numbers, the real number solution extraction unit 21 outputs a “no solution” flag and ends the operation. The “no solution” flag may be a true / false value, for example, or may output a position / orientation value indicating no solution determined in advance.
 連立多項式に1つでも実数解があった場合、姿勢候補計算部22は、すべての実数解を入力とし、姿勢の候補を計算する(ステップS14)。計算の結果得られた姿勢の候補は、姿勢候補数集計部23に出力される。姿勢候補計算部22は、得られた実数解をそれぞれ姿勢の候補とされる値(姿勢を表す3×3行列)に変換する処理を行えばよい。 If there is even one real number solution in the simultaneous polynomial, the posture candidate calculation unit 22 receives all real number solutions and calculates a posture candidate (step S14). The posture candidates obtained as a result of the calculation are output to the posture candidate number counting unit 23. The posture candidate calculation unit 22 may perform a process of converting the obtained real number solution into values (3 × 3 matrix representing the posture) each of which is a posture candidate.
 姿勢候補数集計部23は、姿勢候補計算部22の計算の結果得られた姿勢の候補が入力されると、入力された姿勢の候補の数を計数し、計数結果である姿勢の候補の数に応じて以降の処理を分岐させる(ステップS15)。 When the posture candidates obtained as a result of the calculation of the posture candidate calculation unit 22 are input, the posture candidate count totaling unit 23 counts the number of input posture candidates, and the number of posture candidates as a counting result. The subsequent processing is branched according to (step S15).
 姿勢候補数集計部23は、姿勢の候補の数が1つならば、位置候補計算部27にその姿勢を出力する(ステップS18へ進む)。姿勢の候補の数が複数ならば、姿勢候補数集計部23は、入力されたすべての姿勢の候補を入力点数集計部24に出力する(ステップS16へ進む)。 If the number of posture candidates is one, the posture candidate number counting unit 23 outputs the posture to the position candidate calculation unit 27 (proceeds to step S18). If there are a plurality of posture candidates, the posture candidate count totaling unit 23 outputs all input posture candidates to the input score totaling unit 24 (proceeds to step S16).
 姿勢の候補の数が複数であった場合、入力点数集計部24には、姿勢候補数集計部23により出力された複数の姿勢の候補とともに、ステップS11に入力されたものと同じ3次元座標または/および2次元座標とが入力される。入力点数集計部24は、入力された3次元座標または2次元座標の数を計数し、計数結果である入力点数に応じて以降の処理を分岐させる(ステップS16)。 When there are a plurality of posture candidates, the input point totaling unit 24, together with the plurality of posture candidates output by the posture candidate number totaling unit 23, the same three-dimensional coordinates as those input in step S11 or / And two-dimensional coordinates are input. The input point totaling unit 24 counts the number of input three-dimensional coordinates or two-dimensional coordinates, and branches the subsequent processing according to the input point number that is the counting result (step S16).
 入力点数集計部24は、入力点数が3点の場合、入力されたすべての姿勢の候補と入力点数情報とを位置候補計算部27に出力する(ステップS18へ進む)。入力点数が3点の場合、すべての姿勢の候補における誤差が0となることから、どの候補が正解に最も近いかを判別することができないからである。一方、入力点数が4点以上の場合には、各候補における誤差が異なることから、ただ一つの誤差最小の候補を選択することが可能なため、入力点数集計部24は、入力されたすべての姿勢の候補を誤差最小候補抽出部25に出力する。入力点数情報は、入力点数を示す情報であって、入力点数そのものを示した数値情報でもよいし、3点であることを示すフラグでもよい。 When the number of input points is 3, the input point totaling unit 24 outputs all the input posture candidates and the input point number information to the position candidate calculating unit 27 (proceeds to step S18). This is because when the number of input points is 3, the error in all the posture candidates is 0, and it is impossible to determine which candidate is closest to the correct answer. On the other hand, when the number of input points is 4 or more, since the error in each candidate is different, it is possible to select only one candidate with the smallest error. The posture candidates are output to the minimum error candidate extraction unit 25. The input point information is information indicating the number of input points, and may be numerical information indicating the number of input points themselves or a flag indicating that there are three points.
 姿勢の候補の数が複数であってかつ入力点数が4点以上であった場合、誤差最小候補抽出部25には、ステップS16の判定処理によりすべての姿勢の候補が入力される。誤差最小候補抽出部25は、入力されたすべての姿勢の候補の中から、誤差関数が最小となる1の姿勢を計算し、位置候補計算部27に出力する(ステップS17)。 When there are a plurality of posture candidates and the number of input points is four or more, all posture candidates are input to the minimum error candidate extraction unit 25 by the determination processing in step S16. The minimum error candidate extraction unit 25 calculates one posture that minimizes the error function from all input posture candidates, and outputs the calculated one to the position candidate calculation unit 27 (step S17).
 ステップS18では、位置候補計算部27には、ステップS15の判定処理により姿勢の候補の数が1つであればその姿勢候補が最小誤差の姿勢として入力される。または、ステップS16の判定処理により姿勢候補の数が複数であって入力点数が3点であればそのすべての姿勢候補が最小誤差の姿勢として入力点数情報とともに位置候補計算部27に入力される。または、ステップS17の処理により誤差関数が最小となった1の姿勢が位置候補計算部27に入力される。位置候補計算部27は、1つの姿勢が入力された場合には、その姿勢に対応する位置を計算し、その位置姿勢を推定結果として出力する。位置候補計算部27は、複数の姿勢の候補と入力点数情報(ここでは、3点を示す情報)とが入力された場合には、入力された複数の姿勢の候補を姿勢に変換し、それぞれの姿勢に対応する位置を計算し、計算されたすべての位置姿勢を推定結果の位置姿勢として出力する。 In step S18, if the number of posture candidates is one by the determination processing in step S15, the posture candidate is input to the position candidate calculation unit 27 as the posture with the minimum error. Alternatively, if there are a plurality of posture candidates and the number of input points is three by the determination processing in step S16, all the posture candidates are input to the position candidate calculation unit 27 together with the input point number information as the posture of the minimum error. Alternatively, the one posture whose error function is minimized by the process of step S <b> 17 is input to the position candidate calculation unit 27. When one posture is input, the position candidate calculation unit 27 calculates a position corresponding to the posture and outputs the position and posture as an estimation result. When a plurality of posture candidates and input point number information (in this case, information indicating three points) are input, the position candidate calculation unit 27 converts the input plurality of posture candidates into postures, The position corresponding to the posture is calculated, and all the calculated positions and postures are output as the position and posture of the estimation result.
 以下、具体的な例を用いて本実施形態を説明する。本実施例において、3次元座標と2次元座標の数は、必ず等しいとする。 Hereinafter, the present embodiment will be described using specific examples. In this embodiment, it is assumed that the number of three-dimensional coordinates and two-dimensional coordinates are always equal.
 まず、誤差関数の定義について説明する。以下では、上添字のTは行列およびベクトルの転置、0はゼロ行列およびゼロベクトル、Iは単位行列、detは行列式、∥∥はベクトルのL2ノルムを表す。また、入力点数をn点とし、i番目の3次元座標をX、斉次化した2次元座標をv、カメラ姿勢を行列R、カメラ位置をベクトルt、tからvへの相対的な位置をベクトルc、vの比例定数をλと表す。ここで、Rはdet(R)=1、RR=Iの拘束条件を持つ。 First, the definition of the error function will be described. In the following, the superscript T is a transpose of a matrix and a vector, 0 is a zero matrix and a zero vector, I is a unit matrix, det is a determinant, and ∥ is an L2 norm of a vector. Also, the input number is n points, relative to the i-th three-dimensional coordinates X i, Qi Tsugika the two-dimensional coordinates of v i, the camera posture matrix R, the camera position vector t, from t to v i vector c i the Do position, the proportional constant of v i represents the lambda i. Here, R has a constraint condition of det (R) = 1 and RR T = I.
 内部パラメータが既知のカメラにおいて、Xとvの関係は以下の式(1)で表される。 Internal parameters in known camera, the relationship between X i and v i is expressed by the following equation (1).
λ=RX+t-c ・・・式(1) λ i v i = RX i + t−c i (1)
 また、式(1)より、推定されたRとtの誤差は以下の式(2)で表される。 Also, from the equation (1), the estimated error between R and t is expressed by the following equation (2).
Figure JPOXMLDOC01-appb-M000001
Figure JPOXMLDOC01-appb-M000001
 また、式(2)をλについて微分したものをゼロとおき、式(2)に代入すると以下の式(3)を得る。 In addition, if the result obtained by differentiating equation (2) with respect to λ i is set to zero and substituted into equation (2), the following equation (3) is obtained.
Figure JPOXMLDOC01-appb-M000002
Figure JPOXMLDOC01-appb-M000002
 ここでは、微分によりλを消去したが、vをベクトルの外積を示す歪対称行列に変換し、上記の式(1)の両辺に掛けて消去してもよい。 Here, λ i is eliminated by differentiation, but v i may be converted to a distortion symmetric matrix indicating the outer product of the vectors and erased by multiplying both sides of the above equation (1).
 次いで、式(3)をtについて微分したものをゼロとおくと、最適なtは以下の式(4)で表される。 Next, when the value obtained by differentiating the expression (3) with respect to t is set to zero, the optimum t is expressed by the following expression (4).
Figure JPOXMLDOC01-appb-M000003
Figure JPOXMLDOC01-appb-M000003
 なお、式(4)において、rはRをベクトル化したものである。また、最適なtを式(3)に代入すると、誤差関数は、制約付き非線形最適化問題として以下の式(5)で表される。 In equation (4), r is a vectorization of R. Further, when the optimum t is substituted into Expression (3), the error function is expressed by the following Expression (5) as a constrained nonlinear optimization problem.
min rr+M r+M ・・・式(5)
ただし、s,t,det(R)=1,RR=I
min r T M 1 r + M 2 T r + M 3 (5)
However, s, t, det (R) = 1, RR T = I
 M、M、Mは以下の式(6)で表される。 M 1 , M 2 , and M 3 are represented by the following formula (6).
Figure JPOXMLDOC01-appb-M000004
Figure JPOXMLDOC01-appb-M000004
 上記の式(5)において、Rを自由度3で表現するには、例えば、X軸、Y軸、Z軸に対するオイラー角を用いてもよいし、正規化した四元数q=[q,q,q,q](∥q∥=1、q≧0)を用いてもよいし、9変数で行列式が1の直交行列を用いてもよい。また、以下のようにしてもよい。 In the above formula (5), in order to express R with 3 degrees of freedom, for example, Euler angles with respect to the X axis, the Y axis, and the Z axis may be used, or the normalized quaternion q = [q 0 , Q 1 , q 2 , q 3 ] (∥q∥ = 1, q 0 ≧ 0), or an orthogonal matrix with 9 variables and a determinant of 1 may be used. The following may also be used.
 すなわち、式(5)において、Rを正規化されていない四元数q=[1,a,b,c]により表し、Rの拘束条件をdet(R)=∥q∥、RR=∥q∥Iと緩和すると、誤差関数は3変数の制約なし非線形最適化問題として以下の式(7)で表される。 That is, in Equation (5), R is represented by an unnormalized quaternion q = [1, a, b, c], and the constraint condition of R is det (R) = ∥q∥ 6 , RR T = When relaxing with ∥q∥ 4 I, the error function is expressed by the following equation (7) as a three-variable unconstrained nonlinear optimization problem.
min rr+∥q∥ r+∥q∥ ・・・式(7) min r T M 1 r + ∥q∥ 2 M 2 T r + ∥q∥ 4 M 3 Formula (7)
 rは、以下の式(8)で表される。 R is represented by the following formula (8).
Figure JPOXMLDOC01-appb-M000005
Figure JPOXMLDOC01-appb-M000005
 上述の式(5)の誤差関数と式(7)の誤差関数とは定数が異なるので、式(7)の最適解を定数倍することによって、式(5)の最適解が得られる。 Since the error function of equation (5) and the error function of equation (7) have different constants, the optimum solution of equation (5) can be obtained by multiplying the optimum solution of equation (7) by a constant.
 そこで、以下、式(7)で定義した誤差関数を最小化する条件を説明する。式(7)は制約なし非線形最適化問題であるため、最適解は、式(7)をa,b,cで偏微分した勾配をゼロとおいた連立多項式の解となる。 Therefore, the conditions for minimizing the error function defined by Equation (7) will be described below. Since Equation (7) is a non-constrained nonlinear optimization problem, the optimum solution is a solution of simultaneous polynomials with the gradient obtained by partial differentiation of Equation (7) by a, b, and c being zero.
 x=[a,b,c]、連立多項式の係数を行列N、項を表すベクトルz=[a,ab,ab,b,ac,abc,bc,ac,bc,c,a,ab,b,ac,bc,c,a,b,c,1]とすると、連立多項式は以下の式(9)で表される。 x = [a, b, c] T , coefficient of simultaneous polynomial matrix N, vector z = [a 3 , a 2 b, ab 2 , b 3 , a 2 c, abc, b 2 c, ac 2 , bc 2 , c 3 , a 2 , ab, b 2 , ac, bc, c 2 , a, b, c, 1] T , the simultaneous polynomial is expressed by the following equation (9).
Figure JPOXMLDOC01-appb-M000006
Figure JPOXMLDOC01-appb-M000006
 zの項順序は次数付き逆辞書式順序、次数付き辞書式順序、辞書式順序などに設定可能である。 The term order of z can be set to reverse lexicographic order with order, lexicographic order with order, lexicographic order, etc.
 次に、本実施形態における各部の動作を具体的に説明する。 Next, the operation of each part in the present embodiment will be specifically described.
 ステップS11において、係数計算部11は、Xとv(1≦i≦n)を入力とし、式(7)をa,b,cで偏微分した勾配をゼロとおいた連立多項式の係数行列Nを計算し、連立多項式求解部12に出力する。 In step S11, the coefficient calculation unit 11 has X i and v i (1 ≦ i ≦ n) as inputs, and a coefficient matrix of a simultaneous polynomial in which the gradient obtained by partial differentiation of equation (7) with a, b, and c is zero. N is calculated and output to the simultaneous polynomial solving unit 12.
 ステップS12では、連立多項式求解部12は、係数行列Nを入力とし、連立多項式Nz=0の解を実数解抽出部21に出力する。 In step S12, the simultaneous polynomial solving unit 12 receives the coefficient matrix N and outputs a solution of the simultaneous polynomial Nz = 0 to the real number solution extracting unit 21.
 連立多項式の解法は、例えば、zの項順序に従ったグレブナー基底を計算することである。グレブナー基底を求める方法として、Buchbergerアルゴリズム、F4アルゴリズム、XLアルゴリズムなどがある。また、zに現れる項は計算毎に変わらないため、グレブナー基底を求めずに、Kukelovaらの方法を利用してもよい。Kukelovaらの方法は、グレブナー基底に現れる項を事前計算により求め、係数行列Nからグレブナー基底を構成するAction Matrixを計算し、Action Matrixの固有値分解により解を得る方法である。これらの方法により連立多項式Nz=0を解くと、複素数解を含め全部で27個の解が得られる。 The solution of simultaneous polynomials is, for example, to calculate the Gröbner basis according to the z term order. As a method for obtaining the Gröbner basis, there are a Buchberger algorithm, an F4 algorithm, an XL algorithm, and the like. Further, since the term appearing in z does not change every calculation, the method of Kukelova et al. May be used without obtaining the Gröbner basis. The method of Kukelova et al. Is a method for obtaining a term appearing in a Gröbner basis by pre-calculation, calculating Action Matrix that constitutes the Gröbner basis from the coefficient matrix N, and obtaining a solution by eigenvalue decomposition of the Action Matrix. When the simultaneous polynomial Nz = 0 is solved by these methods, a total of 27 solutions including complex solutions can be obtained.
 次いで、ステップS13では、実数解抽出部21が、連立多項式Nz=0の27個の解を入力とし、27個の解からすべての実数解を計算し、姿勢候補計算部22に出力する。実数解抽出部21は、すべての解が複素数であれば、ステップS19に進み、解なしのフラグを出力して動作を終了する。解なしのフラグは、例えば、真偽値であってもよい。実数解抽出部21は、事前に決定した解なしを表す位置姿勢の値を出力してもよい。 Next, in step S13, the real solution extraction unit 21 receives 27 solutions of the simultaneous polynomial Nz = 0, calculates all real solutions from the 27 solutions, and outputs them to the posture candidate calculation unit 22. If all the solutions are complex numbers, the real number solution extraction unit 21 proceeds to step S19, outputs a no solution flag, and ends the operation. The no solution flag may be a true / false value, for example. The real number solution extraction unit 21 may output a position / orientation value indicating no solution determined in advance.
 ステップS14では、姿勢候補計算部22は、すべての実数解を入力とし、姿勢の候補を計算し、姿勢候補数集計部23に出力する。姿勢の候補は、以下の式(10)で与えられる。 In step S14, the posture candidate calculation unit 22 receives all real number solutions, calculates posture candidates, and outputs the posture candidates to the posture candidate count totaling unit 23. Posture candidates are given by the following equation (10).
Figure JPOXMLDOC01-appb-M000007
Figure JPOXMLDOC01-appb-M000007
 式(10)は、姿勢(3×3行列)の全9個の各要素の計算方法を表している。例えば、実数解がk個あるといった場合には、[a,b,c]がk組あることを意味し、姿勢候補計算部22は、このk組の[a,b,c]を1組ずつ式(10)に代入し、k個の姿勢の候補(3×3行列)を求めればよい。 Equation (10) represents a calculation method for all nine elements of the posture (3 × 3 matrix). For example, if there are k real number solutions, it means that there are k sets of [a, b, c], and the posture candidate calculation unit 22 sets one set of k sets of [a, b, c]. Substituting into Equation (10) one by one, k candidate candidates (3 × 3 matrix) may be obtained.
 次いで、ステップS15では、姿勢候補数集計部23が、算出された姿勢の候補を入力とし、姿勢の候補の数を計算する。姿勢の候補の数が1つならば、姿勢の候補を式(11)により姿勢に変換し、位置候補計算部26に出力する。姿勢候補数集計部23は、姿勢の候補から姿勢に変換するときに、姿勢の候補それぞれを、該当する[a,b,c]を用いて1/(∥q∥)倍すればよい。なお、∥q∥=1+a+b+cである。 Next, in step S15, the posture candidate number counting unit 23 receives the calculated posture candidates as input and calculates the number of posture candidates. If the number of posture candidates is one, the posture candidates are converted into postures by Expression (11) and output to the position candidate calculator 26. The posture candidate count totaling unit 23 may multiply each of the posture candidates by 1 / (∥q∥ 2 ) using the corresponding [a, b, c] when converting the posture candidates into postures. Note that ∥q∥ 2 = 1 + a 2 + b 2 + c 2 .
Figure JPOXMLDOC01-appb-M000008
Figure JPOXMLDOC01-appb-M000008
 ステップS15での計数の結果、姿勢の候補の数が複数ならば、姿勢候補数集計部23はすべての姿勢の候補を入力点数集計部24に出力する。 If the number of posture candidates is plural as a result of the counting in step S15, the posture candidate count totaling unit 23 outputs all the posture candidates to the input score totaling unit 24.
 ステップS16では、入力点数集計部24にXまたはv(1≦i≦n)が入力される。入力点数集計部24は、n=3の場合にはすべての姿勢の候補を入力点数情報としてのnとともに、位置候補計算部26に出力する。なお、入力点数集計部24は、姿勢の候補を式(11)により姿勢に変換した上で、入力点数情報としてのnとともに、変換結果であるすべての姿勢とを位置候補計算部26に出力してもよい。入力点数集計部24は、入力点数情報としてnを出力してもよいし、n=3であることを示すフラグを出力してもよい。 In step S16, X i or v i (1 ≦ i ≦ n ) is input to the input number counting unit 24. When n = 3, the input point totaling unit 24 outputs all posture candidates to the position candidate calculating unit 26 together with n as input point information. The input score totaling unit 24 converts the posture candidates into postures using the equation (11), and outputs all postures as conversion results to the position candidate calculation unit 26 together with n as input point number information. May be. The input point totaling unit 24 may output n as the input point information, or may output a flag indicating that n = 3.
 また、ステップS16において、n≧4の場合には、入力点数集計部24は、すべての姿勢の候補を誤差最小候補抽出部25に出力する。 In step S16, when n ≧ 4, the input point totaling unit 24 outputs all posture candidates to the minimum error candidate extracting unit 25.
 ステップS17で、誤差最小候補抽出部25は、複数の姿勢の候補を入力とし、それぞれをベクトル化して式(7)に代入し、式(7)が最小となる姿勢の候補を姿勢として位置候補計算部26に出力する。 In step S17, the minimum error candidate extraction unit 25 receives a plurality of posture candidates, vectorizes them and substitutes them into equation (7), and uses the posture candidate that minimizes equation (7) as a position candidate. It outputs to the calculation part 26.
 そして、ステップS18では、位置候補計算部26に1つの姿勢または複数の姿勢(もしくは姿勢の候補)と入力点数とが入力される。位置候補計算部26は、姿勢の候補が入力された場合には、式(11)により姿勢に変換した上で、入力された1つの姿勢または複数の姿勢と入力点数とに基づいて、1組の位置と姿勢または複数の位置と姿勢を計算し、出力する。位置は、式(4)により計算される。 In step S18, one or a plurality of postures (or posture candidates) and the number of input points are input to the position candidate calculation unit 26. When a candidate for posture is input, the position candidate calculation unit 26 converts the posture into a posture by Expression (11), and then sets one set based on the input one posture or a plurality of postures and the number of input points. Calculates and outputs the position and orientation of multiple or multiple positions and orientations. The position is calculated by equation (4).
 本実施例では、位置姿勢計算部2において、最初にすべての実数解を抽出し、一括処理により実数解から最適解の候補を絞り込んだが、連立多項式の解を1つずつ逐次的に処理することも可能である。例えば、連立多項式求解部12が1つ解を求めるたびに、実数解抽出部21に解を出力する。実数解抽出部21により実数解と判定されれば、姿勢候補計算部22による姿勢候補への変換処理、入力点数集計部24による入力点数の判定処理、誤差最小候補抽出部25による誤差最小候補判定処理がループ処理により実行される。そして、誤差最小候補抽出部25は、誤差最小候補判定処理として、誤差が最小になる候補をその都度記憶しておき、実数解が抽出される度に、誤差計算、誤差最小値の比較処理、最小候補および最小値の上書き処理を行ってもよい。ここで、姿勢候補数および入力点数による分岐処理を、誤差最小候補抽出部25がまとめて行うようにしてもよい。なお、姿勢候補数および入力点数による分岐処理は、逐次的に処理する場合に限らず、誤差最小候補抽出部25がまとめて行うことも可能である。そのような場合には、姿勢候補計算部22および入力点数集計部24は省略可能である。 In the present embodiment, the position / orientation calculation unit 2 first extracts all real solutions and narrows down candidates for the optimal solution from the real solutions by batch processing, but sequentially processes the solutions of simultaneous polynomials one by one. Is also possible. For example, every time the simultaneous polynomial solving unit 12 obtains one solution, the solution is output to the real number solution extracting unit 21. If the real solution extraction unit 21 determines that the solution is a real number, conversion processing to a posture candidate by the posture candidate calculation unit 22, input point determination processing by the input point totaling unit 24, and minimum error candidate determination by the minimum error candidate extraction unit 25 Processing is executed by loop processing. The minimum error candidate extraction unit 25 stores, as the minimum error candidate determination process, a candidate with the minimum error each time, and every time a real solution is extracted, an error calculation, a minimum error comparison process, Overwriting processing of the minimum candidate and the minimum value may be performed. Here, the branching process based on the number of posture candidates and the number of input points may be collectively performed by the minimum error candidate extraction unit 25. Note that the branching process based on the number of posture candidates and the number of input points is not limited to sequential processing, and can be performed collectively by the minimum error candidate extraction unit 25. In such a case, the posture candidate calculation unit 22 and the input score totaling unit 24 can be omitted.
 また、本実施例では、誤差最小候補抽出部25は、誤差関数として式(7)を用いたが、式(5)や再投影誤差を用いることも可能である。式(5)を用いる場合、誤差最小候補抽出部25は、すべての姿勢の候補を式(11)より姿勢に変換し、式(5)に代入する。再投影誤差を用いる場合、誤差最小候補抽出部25は、まず、すべての姿勢の候補を式(11)より姿勢に変換する。次に、誤差最小候補抽出部25は、すべての姿勢に対する位置を計算する。次に、誤差最小候補抽出部26は、すべての姿勢と位置を入力とし、再投影誤差が最小となる位置と姿勢を出力する。 In this embodiment, the minimum error candidate extraction unit 25 uses Expression (7) as an error function, but Expression (5) and reprojection error can also be used. When using equation (5), the minimum error candidate extraction unit 25 converts all posture candidates into postures from equation (11) and substitutes them into equation (5). In the case of using a reprojection error, the minimum error candidate extraction unit 25 first converts all posture candidates into postures from Equation (11). Next, the minimum error candidate extraction unit 25 calculates positions for all postures. Next, the minimum error candidate extraction unit 26 receives all postures and positions, and outputs a position and posture that minimizes the reprojection error.
 以上のように、本実施形態では、高精度かつ安定的にカメラまたは被写体の位置姿勢を推定することができる。 As described above, in this embodiment, the position and orientation of the camera or subject can be estimated with high accuracy and stability.
 その理由は、以下の通りである。まず、3自由度の姿勢を変数とする誤差関数は3次元座標の分布や入力点数に依存しないため、異なる位置姿勢の計算方法を適用する必要がない。また、非線形最適化法を用いないため、計算コストが少ない。また、誤差関数の勾配をゼロとした連立多項式を解くことで最適解の候補がすべて計算され、誤差関数が最小となる候補が抽出されるため、出力された位置姿勢が大域的最小解であることが保証されるからである。 The reason is as follows. First, since the error function having the three-degree-of-freedom posture as a variable does not depend on the distribution of the three-dimensional coordinates or the number of input points, it is not necessary to apply a different position / posture calculation method. Moreover, since the nonlinear optimization method is not used, the calculation cost is low. Also, solving the simultaneous polynomial with the error function gradient being zero will calculate all the optimal solution candidates and extract the candidate with the smallest error function, so the output position and orientation is the global minimum solution This is because it is guaranteed.
 すなわち、本実施形態による位置姿勢推定方法は、なんらかの手法で大域的最適解に近いと思われる値を1つ探索し、それを初期値として非線形最適化を行うといった従来方法とは異なり、連立多項式を解いて誤差関数の最小値となる候補をすべて求め、その中から誤差が最小となる候補を最適値とする。 That is, the position and orientation estimation method according to the present embodiment is different from the conventional method in which one method is used to search for one value that seems to be close to the global optimal solution and nonlinear optimization is performed using the value as an initial value. To find all candidates for the minimum value of the error function, and select the candidate with the minimum error as the optimum value.
 誤差関数の勾配をゼロとした連立多項式の解は停留点と呼ばれ、誤差関数が最小となるための必要条件である。しかし、停留点は十分条件ではないため、上述したように全候補から大域的最適解を絞り込む必要がある。一般的な方法のように、非線形最適化を用いる場合には、連立多項式に代入してもゼロとはならない初期値から、連立多項式がゼロとなるような値が探索される。すると、連立多項式の解の1つが探索されることにすぎないため、探索された解が大域的最適解である保証はない。また、最適化により解を探索する方法では、局所最適解と大域的最適解とを判別することは困難である。 The solution of the simultaneous polynomial with the error function gradient being zero is called the stop point, and is a necessary condition for the error function to be minimized. However, since the stopping point is not a sufficient condition, it is necessary to narrow down the global optimum solution from all candidates as described above. When nonlinear optimization is used as in a general method, a value that makes the simultaneous polynomial zero is searched for from an initial value that does not become zero even if it is substituted into the simultaneous polynomial. Then, since only one solution of the simultaneous polynomial is searched, there is no guarantee that the searched solution is a global optimal solution. Further, in the method of searching for a solution by optimization, it is difficult to discriminate between a local optimum solution and a global optimum solution.
 例えば、非特許文献1に記載された方法では、姿勢の自由度を無視して計算することにより非常に簡易な計算方法で解を求めることができるが、自由度を3にして計算した場合と比較して精度の悪い値が得られる。このため、非特許文献3に記載された方法等を利用して、自由度3が満たされるように非線形最適化を行う必要が生ずる。これに対して、本実施形態では、最適化を行わずに、最適値になりうる全候補を求めることができる。すなわち、大域的最適解の可能性がある値をすべて計算し、それから絞り込むという方法が採用される。よって、高精度かつ安定的にカメラまたは被写体の位置姿勢を推定することができる。 For example, in the method described in Non-Patent Document 1, a solution can be obtained by a very simple calculation method by ignoring the degree of freedom of the posture. A value with poor accuracy is obtained by comparison. For this reason, it is necessary to perform nonlinear optimization so that the degree of freedom 3 is satisfied by using the method described in Non-Patent Document 3. On the other hand, in this embodiment, all candidates that can be the optimum value can be obtained without performing optimization. That is, a method is adopted in which all values that have the possibility of a global optimal solution are calculated and then narrowed down. Therefore, the position and orientation of the camera or subject can be estimated with high accuracy and stability.
実施形態2.
 次に、本発明の第2の実施形態について図面を参照して説明する。図3は、本発明の第2の実施形態の位置姿勢推定装置の構成例を示すブロック図である。本実施形態の位置姿勢推定装置は、図1に示した第1の実施形態と比べて、位置姿勢計算部2がさらに2次最適性検証部31を有する点が異なる。
Embodiment 2. FIG.
Next, a second embodiment of the present invention will be described with reference to the drawings. FIG. 3 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the second embodiment of the present invention. The position / orientation estimation apparatus according to this embodiment is different from the first embodiment shown in FIG. 1 in that the position / orientation calculation unit 2 further includes a secondary optimality verification unit 31.
 2次最適性検証部31は、実数解抽出部21から出力される実数解を入力とし、誤差関数を変数で2階微分したヘッセ行列の正定値性を検証し、正定値である実数解を2次最適性十分条件を満たす解として最適姿勢候補部23に出力する。 The second-order optimality verification unit 31 receives the real number solution output from the real number solution extraction unit 21 as input, verifies the positive definiteness of the Hessian matrix obtained by second-order differentiation of the error function with a variable, and calculates a real number solution that is a positive definite value The solution is output to the optimal posture candidate unit 23 as a solution satisfying the second-order optimality sufficient condition.
 また、2次最適性検証部31は、検証結果、正定値である実数解が存在しない場合、以降の処理を打ち切って解なしのフラグを出力する。 Further, when the verification result shows that there is no real solution that is a positive definite value, the secondary optimality verification unit 31 aborts the subsequent processing and outputs a no solution flag.
 本実施形態において、2次最適性検証部31は、例えば、特定の演算処理等を行うよう設計されたハードウェア、またはプログラムに従って動作するCPU等の情報処理装置によって実現される。 In the present embodiment, the secondary optimality verification unit 31 is realized by, for example, hardware designed to perform specific arithmetic processing or the like, or an information processing apparatus such as a CPU that operates according to a program.
 次に、本実施形態の動作を図4を参照して説明する。図4は、本実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。以下、ステップS21以外の動作については第1の実施形態と同様であるため、説明を省略する。 Next, the operation of this embodiment will be described with reference to FIG. FIG. 4 is a flowchart showing an example of the operation of the position / orientation estimation apparatus of this embodiment. Since the operations other than step S21 are the same as those in the first embodiment, description thereof will be omitted.
 2次最適性検証部31は、実数解抽出部21により抽出された連立多項式の実数解に対して、誤差関数を変数で2階微分したヘッセ行列の正定値性を検証し、正定値である実数解を2次最適性十分条件を満たす解として最適姿勢候補部23に出力する(ステップS21)。2次最適性検証部31は、すべての実数解が2次最適性十分条件を満たさない場合、解なしのフラグを出力し、動作を終了する(ステップS21のNo,ステップS19)。解なしのフラグは、例えば、真偽値であってもよい。2次最適性検証部31は、事前に決定した解なしを表す姿勢と位置の値を出力してもよい。 The quadratic optimality verification unit 31 verifies the positive definiteness of the Hessian matrix obtained by second-order differentiation of the error function with respect to the real solution of the simultaneous polynomial extracted by the real number solution extraction unit 21, and is a positive definite value. The real number solution is output to the optimal posture candidate unit 23 as a solution that satisfies the secondary optimality sufficient condition (step S21). When all the real solutions do not satisfy the secondary optimality sufficient condition, the secondary optimality verification unit 31 outputs a no-solution flag and ends the operation (No in step S21, step S19). The no solution flag may be a true / false value, for example. The secondary optimality verification unit 31 may output posture and position values representing no solution determined in advance.
 次に、本実施形態における各部の動作を具体的に説明する。なお、2次最適性検証部31以外の動作は第1の実施形態の場合と同様である。 Next, the operation of each part in the present embodiment will be specifically described. The operations other than the secondary optimality verification unit 31 are the same as those in the first embodiment.
 2次最適性検証部31は、実数解抽出部21から出力される実数解を入力とし、式(7)を[a,b,c]で2階微分したヘッセ行列に実数解を代入する。2次最適性検証部31は、ヘッセ行列が正定値であれば、2次最適性十分条件を満たす解として姿勢候補計算部23に出力する(ステップS21のYes)。正定値のヘッセ行列が1つもない場合、2次最適性検証部31は、実数解抽出部21と同様に解なしのフラグを出力し、終了する(ステップS21のNo)。ヘッセ行列の正定値性を検証するために、2次最適性検証部31は、例えば、ヘッセ行列の首座小行列式がすべてゼロより大きいかどうかを検証してもよいし、ヘッセ行列の固有値がすべてゼロより大きいかどうかを検証してもよい。 The secondary optimality verification unit 31 receives the real number solution output from the real number solution extraction unit 21, and substitutes the real number solution into the Hessian matrix obtained by second-order differentiation of equation (7) by [a, b, c]. If the Hessian matrix is a positive definite value, the secondary optimality verification unit 31 outputs a solution satisfying the secondary optimality sufficient condition to the posture candidate calculation unit 23 (Yes in step S21). When there is no positive definite Hessian matrix, the secondary optimality verification unit 31 outputs a no-solution flag in the same manner as the real solution extraction unit 21, and ends (No in step S21). In order to verify the positive definiteness of the Hessian matrix, the second-order optimality verification unit 31 may verify, for example, whether all the minor determinants of the Hessian matrix are greater than zero, or the eigenvalue of the Hessian matrix may be It may be verified whether all are greater than zero.
 本実施形態では、より高速にカメラまたは被写体の位置姿勢を推定することができる。また、推定結果として出力する位置姿勢の信頼性をより向上させることができる。その理由は、2次最適性検証部31により、連立多項式は満たすが局所最適解ではない不適切な解が排除され、姿勢の候補数が減るためである。 In this embodiment, the position and orientation of the camera or subject can be estimated at higher speed. Further, the reliability of the position and orientation output as the estimation result can be further improved. This is because the second-order optimality verification unit 31 eliminates inappropriate solutions that satisfy the simultaneous polynomials but are not locally optimal solutions, and reduce the number of posture candidates.
 また、2次最適性検証部31で求めた実数解は必ず局所最適解である。よって、その中で誤差最小となる解は大域的最適解であることが保証される。 In addition, the real solution obtained by the secondary optimality verification unit 31 is always a local optimal solution. Therefore, it is guaranteed that the solution having the smallest error among them is a global optimum solution.
 また、2次最適性検証部31で求めた実数解が存在しない場合に、以降の処理を打ち切ることで計算コストを低減できる。 Also, when the real solution obtained by the secondary optimality verification unit 31 does not exist, the calculation cost can be reduced by terminating the subsequent processing.
実施形態3.
 次に、本発明の第3の実施形態を図面を参照して説明する。図5は、本発明の第3の実施形態の位置姿勢推定装置の構成例を示すブロック図である。本実施形態は、図1に示した第1の実施形態または図3に示した第2の実施形態の構成に加えて、さらに平面性検証部4を備える。
Embodiment 3. FIG.
Next, a third embodiment of the present invention will be described with reference to the drawings. FIG. 5 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the third embodiment of the present invention. In addition to the configuration of the first embodiment shown in FIG. 1 or the second embodiment shown in FIG. 3, this embodiment further includes a flatness verification unit 4.
 正面性検証部4は、3次元座標を入力とし、3次元座標がカメラの正面になるように位置姿勢を補正し、出力する処理部である。正面性検証部4は、平面判別部41と、位置姿勢補正部42とを有する。 The frontality verification unit 4 is a processing unit that receives the three-dimensional coordinates, corrects the position and orientation so that the three-dimensional coordinates are in front of the camera, and outputs them. The frontality verification unit 4 includes a plane determination unit 41 and a position / orientation correction unit 42.
 平面判別部41は、3次元座標を入力とし、3次元座標の分布が平面か非平面かを判定し、平面か非平面かのフラグを出力する。 The plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is planar or non-planar, and outputs a flag indicating whether the plane is non-planar.
 位置姿勢補正部42は、平面か非平面かのフラグと3次元座標と位置姿勢とを入力とし、平面であれば3次元座標がカメラの正面にあるかどうかを判定する。位置姿勢補正部42は、3次元座標がカメラの正面になければ、位置姿勢を補正して出力する。 The position / orientation correction unit 42 receives a flag indicating whether it is a plane or non-planar, a three-dimensional coordinate, and a position / orientation. If it is a plane, the position / orientation correction unit 42 determines whether the three-dimensional coordinate is in front of the camera. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation.
 透視投影モデルのカメラでは、3次元座標の分布が平面である場合、符号の不定性によりカメラの位置姿勢に2つの解が存在する。2つの解のうち、1つは3次元座標がカメラの正面にあたり、もう1つは3次元座標がカメラの裏側にあたる。3次元座標がカメラの裏側に存在することは現実的に起こりえない。そこで、本実施形態では、正面性検証部4は、連立多項式を満たす解が実数解であっても3次元座標がカメラの正面に存在しない姿勢は、姿勢として不適切な値であるとして、3次元座標がカメラの正面にあるように位置姿勢を補正し、符号の不定性を除去する処理を行う。 In a perspective projection model camera, if the distribution of the three-dimensional coordinates is a plane, there are two solutions for the position and orientation of the camera due to indefiniteness of the sign. Of the two solutions, one corresponds to the front of the camera and the other corresponds to the back of the camera. It is practically impossible for the three-dimensional coordinates to exist behind the camera. Therefore, in this embodiment, the frontality verification unit 4 determines that a posture in which three-dimensional coordinates do not exist in front of the camera is an inappropriate value as a posture even if the solution satisfying the simultaneous polynomial is a real number solution. The position and orientation are corrected so that the dimensional coordinates are in front of the camera, and processing for removing the indefiniteness of the code is performed.
 本実施形態において、正面性検証部4(より具体的には、平面判別部41、位置姿勢補正部42)は、例えば、特定の演算処理等を行うよう設計されたハードウェア、またはプログラムに従って動作するCPU等の情報処理装置によって実現される。 In this embodiment, the frontality verification unit 4 (more specifically, the plane determination unit 41 and the position / orientation correction unit 42) operates in accordance with, for example, hardware or a program designed to perform specific arithmetic processing or the like. This is realized by an information processing device such as a CPU.
 次に、本実施形態の動作を図6を参照して説明する。図6は、本実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。以下、ステップS31およびステップS32以外の動作は第2の実施形態の場合と同様であるため、説明を省略する。 Next, the operation of this embodiment will be described with reference to FIG. FIG. 6 is a flowchart illustrating an example of the operation of the position / orientation estimation apparatus according to this embodiment. Hereinafter, the operations other than Step S31 and Step S32 are the same as those in the second embodiment, and thus the description thereof is omitted.
 平面判別部41は、3次元座標を入力とし、3次元座標の分布が平面か非平面かを判定し、平面か非平面かのフラグを出力する(ステップS31)。 The plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is plane or non-plane, and outputs a flag indicating whether the plane is non-plane (step S31).
 位置姿勢補正部42は、ステップS11で入力された3次元座標と、平面判別部41から出力される平面か非平面かのフラグと、位置候補計算部27から出力される位置姿勢とを入力とし、フラグが平面を示していた場合に(ステップS31のYes)、3次元座標がカメラの正面にあるかどうかを判定する。位置姿勢補正部42は、3次元座標がカメラの正面になければ、位置姿勢を補正し、推定結果の位置姿勢として出力する(ステップS32)。非平面の場合、位置姿勢補正部42は、入力された位置姿勢をそのまま推定結果の位置姿勢として出力する。 The position / orientation correction unit 42 receives as input the three-dimensional coordinates input in step S11, the flag indicating whether the plane or non-plane is output from the plane determination unit 41, and the position / orientation output from the position candidate calculation unit 27. If the flag indicates a plane (Yes in step S31), it is determined whether or not the three-dimensional coordinates are in front of the camera. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects the position / orientation and outputs the position / orientation as an estimation result (step S32). In the case of a non-planar surface, the position / orientation correction unit 42 outputs the input position / orientation as it is as the position / orientation of the estimation result.
 次に、本実施形態における各部の動作を具体的に説明する。正面性検証部4以外の動作は第2の実施形態の場合と同様である。以下、例として、カメラはc=0の透視投影モデル、3次元座標の分布はすべてのZ座標が0の平面とした場合を例にする。 Next, the operation of each part in this embodiment will be specifically described. Operations other than the frontality verification unit 4 are the same as those in the second embodiment. Hereinafter, as an example, the camera is a perspective projection model with c i = 0, and the three-dimensional coordinate distribution is a plane with all Z coordinates being zero.
 まず、Rの第j列をrとすると、式(1)は、以下の式(12)で表される。 First, when the j-th column of R is r j , the equation (1) is expressed by the following equation (12).
Figure JPOXMLDOC01-appb-M000009
Figure JPOXMLDOC01-appb-M000009
 なお、式(12)は符号に関して不定であるため、[r,r,t]と[-r,-r,-t]とを区別することができない。 In addition, since the expression (12) is indefinite with respect to the sign, [r 1 , r 2 , t] and [−r 1 , −r 2 , −t] cannot be distinguished.
 平面判別部41は、3次元座標を入力とし、3次元座標の分布が平面か非平面かを判定し、平面か非平面かのフラグを出力する(ステップS31)。3次元座標の分布が、すべてのZ座標が0の平面か非平面かを判別するために、平面判別部41は、例えば、すべてのZ座標の符号関数の和の絶対値を計算してもよいし、3次元座標のモーメント行列の行列式がゼロに近いかどうかで判定してもよい。符号関数は、入力値が正であれば+1、負であれば-1、0であれば0を返す関数である。 The plane discriminating unit 41 receives the three-dimensional coordinates, determines whether the distribution of the three-dimensional coordinates is plane or non-plane, and outputs a flag indicating whether the plane is non-plane (step S31). In order to determine whether the distribution of the three-dimensional coordinates is a plane in which all the Z coordinates are 0 or non-planar, the plane determination unit 41 may calculate the absolute value of the sum of the sign functions of all the Z coordinates, for example. Alternatively, the determination may be made based on whether the determinant of the moment matrix of the three-dimensional coordinates is close to zero. The sign function is a function that returns +1 if the input value is positive, -1 if it is negative, and 0 if it is 0.
 平面判別部41は、すべてのZ座標の符号関数の和の絶対値が閾値以下であれば、Z座標が0の平面とする。閾値は、例えば、入力点数の8割というように決められる。 The plane discriminating unit 41 sets the plane having the Z coordinate of 0 if the absolute value of the sum of the sign functions of all the Z coordinates is equal to or less than the threshold value. For example, the threshold is determined as 80% of the number of input points.
 また、モーメント行列を用いる場合、すべてのZ座標が0の平面であれば、モーメント行列の固有値の1つは0である。そのため、平面判別部41は、モーメント行列の行列式がゼロに近いかどうかで0の平面か非平面かを判別する。 Also, when using a moment matrix, if all the Z coordinates are planes of zero, one of the eigenvalues of the moment matrix is zero. Therefore, the plane discriminating unit 41 discriminates whether the plane is a zero plane or a non-plane depending on whether the determinant of the moment matrix is close to zero.
 位置姿勢補正部42は、平面か非平面かのフラグと3次元座標と位置姿勢を入力とし、平面フラグが入力された場合(ステップS31のYes)、3次元座標がカメラの正面にあるかどうかを判定する。そして、3次元座標がカメラの正面になければ、位置姿勢補正部42は、位置姿勢を補正し、出力する(ステップS32)。 The position / orientation correction unit 42 receives a plane / non-planar flag, a three-dimensional coordinate, and a position / orientation. When the plane flag is input (Yes in step S31), whether the three-dimensional coordinate is in front of the camera. Determine. If the three-dimensional coordinates are not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation (step S32).
 非平面フラグが入力された場合(ステップS31のNo)、位置姿勢補正部42は、入力された位置姿勢をそのまま出力する。なお、位置姿勢補正部42は、Z座標が0の平面フラグが入力された場合、カメラの前面に存在する3次元座標の個数を数える。位置姿勢補正部42は、入力された3次元座標群がカメラの正面にないものと判断されれば、位置姿勢を補正して出力する。フラグとして、例えば、真偽値を用いてもよいし、事前に決定した平面を表す値や記号を用いてもよい。 When the non-planar flag is input (No in step S31), the position / orientation correction unit 42 outputs the input position / orientation as it is. Note that the position / orientation correction unit 42 counts the number of three-dimensional coordinates existing in front of the camera when a plane flag having a Z coordinate of 0 is input. If it is determined that the input three-dimensional coordinate group is not in front of the camera, the position / orientation correction unit 42 corrects and outputs the position / orientation. As the flag, for example, a true / false value may be used, or a value or symbol representing a plane determined in advance may be used.
 位置姿勢補正部42は、カメラの前面に存在する3次元座標の個数を数えるために、例えば、符号関数を用いる。Rの第k行をバー付きのr、sgnを符号関数とすると、カメラの前面に存在する3次元座標の個数は式(13)で表される。 The position / orientation correction unit 42 uses, for example, a sign function in order to count the number of three-dimensional coordinates existing on the front surface of the camera. If the k-th row of R is r k with a bar and sgn is a sign function, the number of three-dimensional coordinates existing on the front surface of the camera is expressed by Expression (13).
Figure JPOXMLDOC01-appb-M000010
Figure JPOXMLDOC01-appb-M000010
 位置姿勢補正部42は、式(13)が閾値以下であれば、カメラが反転していると判定する。閾値は、例えば、入力点数の8割、というように決める。カメラが反転していた場合、姿勢を[-r,-r,r]、位置を-tと補正する。 The position / orientation correction unit 42 determines that the camera is inverted if Expression (13) is equal to or less than the threshold value. For example, the threshold is determined as 80% of the number of input points. When the camera is inverted, the posture is corrected to [−r 1 , −r 2 , r 3 ] and the position is corrected to −t.
 本実施形態では、第1の実施形態および第2の実施形態よりも、さらに信頼性の高いカメラまたは被写体の位置姿勢を推定することができる。その理由は、平面判別部41が、3次元座標が必ずカメラの正面にあるように位置姿勢を補正することによって、幾何的に矛盾のない位置姿勢を出力するためである。 In the present embodiment, it is possible to estimate the position and orientation of the camera or the subject with higher reliability than in the first embodiment and the second embodiment. This is because the plane discriminating unit 41 outputs a position and orientation that are geometrically consistent by correcting the position and orientation so that the three-dimensional coordinates are always in front of the camera.
 なお、本実施形態において、正面性検証部4は、入力として3次元座標の分布を示すフラグを受け付け、分布が非平面である場合には処理を省略し、分布が平面、または分布が不明である場合に処理を行うことも可能である。 In this embodiment, the frontality verification unit 4 accepts a flag indicating the distribution of the three-dimensional coordinates as an input, omits the processing when the distribution is non-planar, and the distribution is flat or the distribution is unknown. It is also possible to perform processing in some cases.
 また、3次元分布が不明な場合や平面判別部41の動作を省略したい場合等には、位置姿勢補正部42が補正動作を行わず、出力してもよいか否かの判断を行い、出力してもよいと判断した場合にのみ推定結果としての位置姿勢を出力するといったことも可能である。例えば、位置姿勢補正部42は、式(13)に基づき、カメラの前面に存在する3次元座標の数を数え、その数が閾値以上であれば、入力された3次元座標群がカメラの正面にあると判断し、推定結果として入力された位置姿勢をそのまま出力する。位置姿勢補正部42は、3次元座標の数が閾値以下であれば、入力された3次元座標群がカメラの正面にないと判断し、推定結果として入力された位置姿勢は出力せずにエラーを出力するようにしてもよい。 Further, when the three-dimensional distribution is unknown or when it is desired to omit the operation of the plane discriminating unit 41, the position / orientation correcting unit 42 determines whether or not to output without performing the correcting operation, and outputs It is also possible to output the position / orientation as the estimation result only when it is determined that it is acceptable. For example, the position / orientation correction unit 42 counts the number of three-dimensional coordinates existing on the front surface of the camera based on the equation (13), and if the number is equal to or greater than the threshold, the input three-dimensional coordinate group is the front surface of the camera. The position / orientation input as the estimation result is output as it is. If the number of three-dimensional coordinates is equal to or less than the threshold, the position / orientation correction unit 42 determines that the input three-dimensional coordinate group is not in front of the camera, and does not output the position / orientation input as an estimation result, but generates an error. May be output.
 また、上記説明では、位置姿勢補正部42が、3次元座標を入力として、符号関数を用いてカメラの前面に存在する3次元座標の個数を数えることにより、入力された3次元座標群がカメラの正面にあるか否かを判定する方法が示されたが、2次元座標も入力とすることにより、符号関数を使わずに入力された3次元座標群がカメラの正面にあるか否かを判定することも可能である。 In the above description, the position / orientation correction unit 42 receives the three-dimensional coordinates and counts the number of the three-dimensional coordinates existing on the front surface of the camera using the sign function, so that the input three-dimensional coordinate group becomes the camera. Although the method for determining whether or not it is in front of the camera has been shown, it is possible to determine whether or not the input three-dimensional coordinate group is in front of the camera by using two-dimensional coordinates as input. It is also possible to determine.
 例えば、位置姿勢補正部42は、式(13)に代わり、以下の式(14)を用いて次のように計算する。 For example, the position / orientation correction unit 42 uses the following equation (14) instead of equation (13) to calculate as follows.
Figure JPOXMLDOC01-appb-M000011
Figure JPOXMLDOC01-appb-M000011
 ここで、位置姿勢補正部42は、上記の式(14)が正ならば、入力された3次元座標群がカメラの正面に存在し、負ならばカメラの正面に存在しない(すなわち、カメラの裏側に存在する)と判別すればよい。 Here, the position / orientation correction unit 42 indicates that the input three-dimensional coordinate group exists in front of the camera if the above expression (14) is positive, and does not exist in front of the camera if it is negative (that is, the camera It may be determined that it exists on the back side.
実施形態4.
 次に、本発明の第4の実施形態を図面を参照して説明する。図7は、本発明の第4の実施形態の位置姿勢推定装置の構成例を示すブロック図である。本実施形態は、第3の実施形態に加え、さらに正規化部51と、逆正規化部52とを備える。
Embodiment 4 FIG.
Next, a fourth embodiment of the present invention will be described with reference to the drawings. FIG. 7 is a block diagram illustrating a configuration example of the position and orientation estimation apparatus according to the fourth embodiment of the present invention. The present embodiment further includes a normalization unit 51 and a denormalization unit 52 in addition to the third embodiment.
 正規化部51は、3次元座標を入力とし、事前に決定した正規化パラメータまたは3次元座標により計算した正規化パラメータに基づき、3次元座標を正規化する。そして、正規化部51は、正規化3次元座標と正規化パラメータを出力する。 The normalization unit 51 receives the three-dimensional coordinates and normalizes the three-dimensional coordinates based on the normalization parameters determined in advance or the normalization parameters calculated from the three-dimensional coordinates. Then, the normalization unit 51 outputs normalized three-dimensional coordinates and normalization parameters.
 逆正規化部52は、正規化パラメータと位置姿勢を入力とし、位置姿勢を逆正規化し、出力する。 The denormalization unit 52 receives the normalization parameter and the position and orientation, denormalizes the position and orientation, and outputs the result.
 本実施形態において、正規化部51、逆正規化部52は、例えば、特定の演算処理等を行うよう設計されたハードウェア、またはプログラムに従って動作するCPU等の情報処理装置によって実現される。 In the present embodiment, the normalization unit 51 and the denormalization unit 52 are realized by, for example, hardware designed to perform specific arithmetic processing or the like, or an information processing device such as a CPU that operates according to a program.
 次に、本実施形態の動作を図8を参照して説明する。図8は、本実施形態の位置姿勢推定装置の動作の一例を示すフローチャートである。以下、ステップS41およびステップS42以外の動作は第3の実施形態の場合と同様であるため、説明を省略する。 Next, the operation of this embodiment will be described with reference to FIG. FIG. 8 is a flowchart showing an example of the operation of the position / orientation estimation apparatus of this embodiment. Hereinafter, operations other than step S41 and step S42 are the same as those in the third embodiment, and thus the description thereof is omitted.
 正規化部51は、まず最初に3次元座標を入力とし、事前に決定した正規化パラメータもしくは3次元座標により計算した正規化パラメータに基づき、3次元座標を正規化する(ステップS41)。そして、正規化部51は、正規化した3次元座標を係数計算部11に出力し、正規化パラメータを逆正規化部42に出力する。 The normalization unit 51 first receives the three-dimensional coordinates, and normalizes the three-dimensional coordinates based on the normalization parameters determined in advance or the normalization parameters calculated from the three-dimensional coordinates (step S41). Then, the normalization unit 51 outputs the normalized three-dimensional coordinates to the coefficient calculation unit 11 and outputs the normalization parameters to the inverse normalization unit 42.
 逆正規化部52は、正規化部51から出力される正規化パラメータと、位置候補計算部27から出力される位置姿勢とを入力とし、位置姿勢を逆正規化して、出力する(ステップS42)。 The denormalization unit 52 receives the normalization parameter output from the normalization unit 51 and the position and orientation output from the position candidate calculation unit 27, denormalizes the position and orientation, and outputs the result (step S42). .
 次に、本実施形態における各部の動作を具体的に説明する。正規化部51と、逆正規化部52以外の動作は第3の実施形態の場合と同様である。 Next, the operation of each part in the present embodiment will be specifically described. Operations other than the normalization unit 51 and the denormalization unit 52 are the same as those in the third embodiment.
 内部パラメータが既知のカメラにおいて、2次元座標の範囲は、例えば、[-1,+1]など、適当な値に正規化されている場合が多いため、正規化する必要はない。一方、3次元座標の範囲は、例えば、単位がミリメートルであれば数百、数千になるため、計算の途中で桁あふれを起こすなど数値的不安定の原因になる。 For cameras with known internal parameters, the range of the two-dimensional coordinates is often normalized to an appropriate value such as [−1, +1], so that it is not necessary to normalize. On the other hand, the range of the three-dimensional coordinate is, for example, hundreds or thousands if the unit is millimeters, which causes numerical instability such as overflowing in the middle of calculation.
 そこで、正規化部51は、3次元座標を正規化し、2次元座標と範囲を合わせることで、数値的安定性を向上させる。 Therefore, the normalization unit 51 normalizes the three-dimensional coordinates and matches the range with the two-dimensional coordinates to improve numerical stability.
 ここでは、一例として、平行移動ベクトルp、スケールsによる正規化を説明する。平行移動ベクトルpを、例えば、3次元座標の重心としてもよいし、中央値としてもよい。スケールsは、例えば、3次元座標の標準偏差としてもよいし、3次元座標の最大値としてもよい。 Here, as an example, normalization using a translation vector p and a scale s will be described. The translation vector p may be, for example, the center of gravity of the three-dimensional coordinate or the median value. The scale s may be, for example, a standard deviation of three-dimensional coordinates or a maximum value of three-dimensional coordinates.
 3次元座標の範囲が固定されている場合、平行移動ベクトルpとして、事前に計算したpやsを用いてもよい。正規化部51は、3次元座標を入力とし、事前に決定した正規化パラメータまたは正規化パラメータを計算し、3次元座標を正規化する。そして、正規化部51は、正規化した3次元座標と正規化パラメータを出力する(ステップS41)。 When the range of the three-dimensional coordinates is fixed, p or s calculated in advance may be used as the translation vector p. The normalization unit 51 receives the three-dimensional coordinates as input, calculates a predetermined normalization parameter or normalization parameter, and normalizes the three-dimensional coordinates. Then, the normalization unit 51 outputs the normalized three-dimensional coordinates and normalization parameters (Step S41).
 正規化した3次元座標はs(X-p)である。正規化パラメータは、pとsである。逆正規化部52は、正規化パラメータと位置姿勢を入力とし、位置姿勢を逆正規化し、出力する(ステップS413)。本実施例では、姿勢は正規化による影響を受けないので、そのまま出力される。位置は(1/s)t-Rpと逆正規化されて出力される。 Three-dimensional coordinates obtained by normalizing is s (X i -p). Normalization parameters are p and s. The denormalization unit 52 receives the normalization parameter and the position and orientation, denormalizes the position and orientation, and outputs the result (step S413). In this embodiment, since the posture is not affected by normalization, it is output as it is. The position is denormalized to (1 / s) t-Rp and output.
 本実施形態では、より高精度にカメラまたは被写体の位置姿勢を推定することができる。その理由は、3次元座標を正規化することで計算途中の値のオーダーが下がり、数値的安定性が向上するためである。 In this embodiment, the position and orientation of the camera or subject can be estimated with higher accuracy. The reason for this is that normalizing the three-dimensional coordinates reduces the order of values in the middle of calculation and improves numerical stability.
 なお、上記の各実施形態は、各部に対応したハードウェア等により実現される位置姿勢推定装置に限らず、図9に示すような情報処理システムによっても実現可能である。図9は、本発明による位置姿勢推定装置を情報処理システムに実装した場合のブロック図である。図9に示す情報処理システムは、プロセッサ61と、プログラムメモリ62と、記憶媒体63とを備える一般的な情報処理システムである。 Each of the above embodiments can be realized not only by the position / orientation estimation apparatus realized by hardware corresponding to each unit but also by an information processing system as shown in FIG. FIG. 9 is a block diagram when the position / orientation estimation apparatus according to the present invention is implemented in an information processing system. The information processing system shown in FIG. 9 is a general information processing system including a processor 61, a program memory 62, and a storage medium 63.
 記憶媒体63は、別個の記憶媒体からなる記憶領域であってもよいし、同一の記憶媒体からなる記憶領域であってもよい。記憶媒体として、RAMや、ハードディスク等の磁気記憶媒体を用いることができる。 The storage medium 63 may be a storage area composed of separate storage media, or may be a storage area composed of the same storage medium. As the storage medium, a magnetic storage medium such as a RAM or a hard disk can be used.
 プログラムメモリ61には、上述した最適解候補計算部1(より具体的には、係数計算部11と、連立多項式求解部12)と、最適位置姿勢候補計算部2(より具体的には、実数解抽出部21と、姿勢候補計算部22と、姿勢候補計算部23と、入力点数集計部24と、誤差最小候補抽出部25と、位置候補計算部26)と、2次最適性検証部31と、正面性検証部4(より具体的には、平面判別部41と、位置姿勢補正部42)と、正規化部51と、逆正規化部52の各部の処理を、プロセッサ61に行わせるためのプログラムが格納されており、このプログラムに従ってプロセッサ61は動作する。プロセッサ61は、例えば、CPU等のプログラムに従って動作するプロセッサであればよい。 The program memory 61 includes the above-described optimal solution candidate calculation unit 1 (more specifically, the coefficient calculation unit 11 and the simultaneous polynomial solution unit 12) and the optimal position / orientation candidate calculation unit 2 (more specifically, a real number). Solution extraction unit 21, posture candidate calculation unit 22, posture candidate calculation unit 23, input point totaling unit 24, minimum error candidate extraction unit 25, position candidate calculation unit 26), and secondary optimality verification unit 31 And the frontality verification unit 4 (more specifically, the plane discriminating unit 41 and the position / orientation correction unit 42), the normalization unit 51, and the denormalization unit 52 are processed by the processor 61. Is stored, and the processor 61 operates in accordance with this program. The processor 61 may be a processor that operates according to a program such as a CPU, for example.
 このように、本発明は、コンピュータプログラムにより実現することも可能である。なお、プログラムによる動作が可能な部のすべてをプログラムで動作させる必要はなく、一部をハードウェアで構成してもよい。また、それぞれ別々のユニットとして実現されていてもよい。 Thus, the present invention can be realized by a computer program. Note that it is not necessary to operate all the parts that can be operated by the program by the program, and a part may be configured by hardware. Moreover, you may implement | achieve as a separate unit, respectively.
 次に、本発明の概要について説明する。図10は、本発明の概要を示すブロック図である。図9に示す位置姿勢推定装置は、対象物に関する3以上の、3次元座標と画像上で3次元座標に対応する2次元座標の組を入力とする装置であって、最適解候補計算手段101と、位置姿勢計算手段102とを備えている。 Next, the outline of the present invention will be described. FIG. 10 is a block diagram showing an outline of the present invention. The position / orientation estimation apparatus shown in FIG. 9 is an apparatus that receives a set of three or more three-dimensional coordinates related to an object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image, and includes an optimal solution candidate calculation unit 101. And position / orientation calculation means 102.
 最適解候補計算手段101は、入力された3次元座標と2次元座標の組を用いて、3自由度の姿勢を変数として3次元座標と2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算する。最適解候補計算手段101は、上記実施形態では、例えば、最適解候補計算部1として示されている。 The optimum solution candidate calculation means 101 uses a set of the input 3D coordinates and 2D coordinates and uses a set of 3 degrees of freedom as a variable for a predetermined error function representing the conversion relationship between the 3D coordinates and the 2D coordinates. Thus, all solutions satisfying the simultaneous polynomial with the error function gradient set to zero are calculated. In the above embodiment, the optimal solution candidate calculation unit 101 is shown as the optimal solution candidate calculation unit 1, for example.
 位置姿勢計算手段102は、最適解候補計算手段101によって算出された連立多項式のすべての解の中から、誤差関数が最小となる最適解を抽出し、抽出した最適解に基づき対象物を撮影したカメラの位置姿勢を計算する。位置姿勢計算手段102は、上記実施形態では、例えば、位置姿勢計算部2として示されている。 The position / orientation calculation means 102 extracts the optimal solution that minimizes the error function from all the solutions of the simultaneous polynomials calculated by the optimal solution candidate calculation means 101, and images the object based on the extracted optimal solution. Calculate the camera's position and orientation. The position / orientation calculation means 102 is shown as, for example, the position / orientation calculation unit 2 in the above embodiment.
 また、最適解候補計算手段101は、3次元座標と2次元座標の組を入力とし、連立多項式の係数を計算する係数計算手段と、係数計算手段によって算出された連立多項式の係数を入力とし、連立多項式を満たすすべての解を計算する連立多項式求解手段とを含んでいてもよい。 The optimal solution candidate calculation means 101 receives a set of three-dimensional coordinates and two-dimensional coordinates as input, coefficient calculation means for calculating coefficients of simultaneous polynomials, and coefficients of simultaneous polynomials calculated by the coefficient calculation means as inputs, Simultaneous polynomial solving means for calculating all solutions satisfying the simultaneous polynomials may be included.
 また、位置姿勢計算手段102は、連立多項式のすべての解の中からすべての実数解を抽出し、抽出したすべての実数解または解なしを示すフラグを出力する実数解抽出手段と、実数解抽出手段によって抽出されたすべての実数解を、それぞれ1つの姿勢の候補に変換する姿勢候補計算手段と、姿勢候補計算手段によって変換された姿勢の候補の数と、入力された3次元座標と2次元座標の組の数である入力点数とに基づき、姿勢候補計算手段によって変換されたすべての姿勢の候補の中から、誤差関数が最小となる1または複数の姿勢を抽出する誤差最小候補抽出手段と、誤差最小候補抽出手段によって抽出された誤差関数が最小となる1または複数の姿勢に基づき、各姿勢に対応する位置を計算し、それぞれ1組の位置姿勢として出力する位置候補計算手段とを含んでいてもよい。なお、姿勢候補計算手段による変換処理や誤差最小候補抽出手段による抽出処理は、処理対象とする実数解や姿勢の候補がすべて入力された後で一括で行うだけでなく、処理対象とするデータの入力方法に併せて逐次的に処理することも可能である。 Further, the position / orientation calculation means 102 extracts all real solutions from all solutions of the simultaneous polynomials, and outputs a real number solution extraction means for outputting a flag indicating all the extracted real solutions or no solutions, and real number solution extraction Posture candidate calculation means for converting all real solutions extracted by the means into one posture candidate, the number of posture candidates converted by the posture candidate calculation means, the input three-dimensional coordinates and two-dimensional A minimum error candidate extraction unit that extracts one or a plurality of postures having a minimum error function from all the posture candidates converted by the posture candidate calculation unit based on the number of input points that is the number of sets of coordinates; The position corresponding to each posture is calculated based on one or a plurality of postures in which the error function extracted by the minimum error candidate extracting means is minimized, and each position is output as a set of positions and postures. A position candidate calculation unit that may contain. Note that the conversion processing by the posture candidate calculation means and the extraction processing by the minimum error candidate extraction means are not only performed in batch after all the real number solutions and posture candidates to be processed are input, but also the data to be processed It is also possible to process sequentially according to the input method.
 また、位置姿勢計算手段102は、実数解抽出手段によって抽出されたすべての実数解のうち、2次最適性十分条件を満たす実数解を計算して、出力する2次最適性検証手段を含み、姿勢候補計算手段は、2次最適性検証手段によって2次最適性十分条件を満たすとされたすべての実数解を、それぞれ1つの姿勢の候補に変換してもよい。 The position / orientation calculation means 102 includes secondary optimality verification means for calculating and outputting real solutions satisfying the secondary optimality sufficient condition among all real number solutions extracted by the real number solution extraction means, The posture candidate calculation unit may convert all the real solutions that are determined to satisfy the secondary optimality sufficient condition by the secondary optimality verification unit into one posture candidate.
 また、位置姿勢推定装置は、図1に示された構成に加えて、入力された3次元座標がカメラの正面にあるか否かを判定し、正面にないと判定された場合に、位置姿勢計算手段から出力される位置姿勢を補正するまたはエラーを示すフラグを出力する正面性検証手段を備えていてもよい。 In addition to the configuration shown in FIG. 1, the position / orientation estimation apparatus determines whether or not the input three-dimensional coordinates are in front of the camera. Frontality verification means for correcting the position and orientation output from the calculation means or outputting a flag indicating an error may be provided.
 また、正面性検証手段は、3次元座標が平面か非平面かを判別し、判別結果を出力する平面判別手段と、3次元座標と、判別結果と、位置姿勢計算手段から出力される位置姿勢とを入力として、判別結果が平面であれば、3次元座標がカメラの正面にあるか否かを判定し、正面にないと判定された場合に、位置姿勢を補正する位置姿勢補正手段とを含んでいてもよい。 Further, the frontality verification means determines whether the three-dimensional coordinates are planar or non-planar, outputs a determination result, the three-dimensional coordinates, the determination result, and the position and orientation output from the position and orientation calculation means If the determination result is a plane, it is determined whether or not the three-dimensional coordinate is in front of the camera. May be included.
 また、位置姿勢推定装置は、図1に示された構成に加えて、3次元座標と2次元座標の組が当該位置姿勢推定装置に入力されると、事前に決定した正規化パラメータまたは3次元座標により計算した正規化パラメータに基づき、3次元座標を正規化する正規化手段と、正規化パラメータと、正規化された3次元座標を用いて算出された位置姿勢とを入力とし、正規化パラメータに基づき逆正規化した位置姿勢を計算して出力する逆正規化手段とを備えていてもよい。そのような場合には、最適解候補計算手段101は、正規化手段により正規化された3次元座標を用いて、連立多項式を満たすすべての解を計算する。 In addition to the configuration shown in FIG. 1, the position / orientation estimation apparatus receives a set of three-dimensional coordinates and two-dimensional coordinates, when a normalization parameter or a three-dimensional parameter determined in advance is input to the position / orientation estimation apparatus. Based on the normalization parameter calculated by the coordinates, the normalization means for normalizing the three-dimensional coordinates, the normalization parameters, and the position and orientation calculated using the normalized three-dimensional coordinates are input, and the normalization parameters And a denormalization unit that calculates and outputs a position and orientation that have been denormalized based on the above. In such a case, the optimal solution candidate calculation unit 101 calculates all solutions satisfying the simultaneous polynomials using the three-dimensional coordinates normalized by the normalization unit.
 また、上述の位置姿勢計算手段102は、連立多項式の解からすべての実数解または解なしを示すフラグを出力する実数解抽出手段と、抽出された実数解を入力とし、姿勢の候補を計算する姿勢候補計算手段と、姿勢の候補を入力とし、姿勢の候補の数を計算する姿勢候補数集計手段と、入力された3次元座標または2次元座標と、姿勢の候補とを入力とし、入力された3次元座標または2次元座標の数を計算し、入力点数に基づき、最小誤差の算出対象とする姿勢の候補、または誤差関数がともに最小となる複数の姿勢を出力する入力点数集計手段と、最小誤差の算出対象とする姿勢の候補を入力とし、誤差関数が最小となる1の姿勢を計算し、出力する誤差最小候補抽出手段と、誤差関数が最小となる1または複数の姿勢を入力とし、入力された姿勢それぞれに対応する位置を計算し、出力する位置候補計算手段とを含む構成であってもよい。 The position / orientation calculation means 102 described above receives the real number solution extraction means for outputting a flag indicating all real solutions or no solution from the simultaneous polynomial solution, and the extracted real number solution as inputs, and calculates the attitude candidates. Posture candidate calculation means, posture candidate number input means for calculating the number of posture candidates, input three-dimensional coordinates or two-dimensional coordinates, and posture candidates are input and input. Input point totaling means for calculating the number of three-dimensional coordinates or two-dimensional coordinates, and outputting a plurality of postures for which the error function is minimized, based on the number of input points, or a posture candidate for which the minimum error is to be calculated; The candidate for the posture to be calculated as the minimum error is input, the one posture that minimizes the error function is calculated and output, and the one or more postures that minimize the error function are input. , The positions corresponding to the force posture calculated, and may be configured to include a position candidate calculation unit for outputting.
 以上、実施形態および実施例を参照して本発明を説明したが、本発明は上記実施形態および実施例に限定されない。本発明の構成や詳細には、本発明のスコープ内で当業者が理解し得る様々な変更をすることができる。 As mentioned above, although this invention was demonstrated with reference to embodiment and an Example, this invention is not limited to the said embodiment and Example. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention.
 この出願は、2011年5月20日に出願された日本特許出願2011-113969を基礎とする優先権を主張し、その開示の全てをここに取り込む。 This application claims priority based on Japanese Patent Application 2011-113969 filed on May 20, 2011, the entire disclosure of which is incorporated herein.
 カメラの内部パラメータが既知の場合に、カメラまたは被写体の位置および姿勢を推定する用途に好適に適用可能である。 When the internal parameters of the camera are known, the present invention can be suitably applied to a use for estimating the position and orientation of the camera or subject.
 1 最適解候補計算部
 11 係数計算部
 12 連立多項式求解部
 2 最適位置姿勢候補計算部
 21 実数解抽出部
 22 姿勢候補計算部
 23 姿勢候補集計部
 24 入力点数集計部
 25 誤差宰相候補抽出部
 26 位置候補計算部
 31 2次最適性検証部
 4 正面性検証部
 41 正面判別部
 42 位置姿勢補正部
 51 正規化部
 52 逆正規化部
 61 記録媒体
 62 プロセッサ
 63 プログラムメモリ
 101 最適解候補計算手段
 102 位置姿勢計算手段
DESCRIPTION OF SYMBOLS 1 Optimal solution candidate calculation part 11 Coefficient calculation part 12 Simultaneous polynomial solution part 2 Optimal position and posture candidate calculation part 21 Real number solution extraction part 22 Posture candidate calculation part 23 Posture candidate totaling part 24 Input point totaling part 25 Error phase candidate extraction part 26 Position Candidate calculation unit 31 Secondary optimality verification unit 4 Frontality verification unit 41 Front discrimination unit 42 Position and orientation correction unit 51 Normalization unit 52 Denormalization unit 61 Recording medium 62 Processor 63 Program memory 101 Optimal solution candidate calculation means 102 Position and orientation Calculation means

Claims (9)

  1.  対象物に関する3以上の、3次元座標と画像上で前記3次元座標に対応する2次元座標の組を入力とし、
     入力された前記3次元座標と前記2次元座標の組を用いて、3自由度の姿勢を変数として前記3次元座標と前記2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算する最適解候補計算手段と、
     前記最適解候補計算手段によって算出された前記連立多項式のすべての解の中から、前記誤差関数が最小となる最適解を抽出し、抽出した前記最適解に基づき前記対象物を撮影したカメラの位置姿勢を計算する位置姿勢計算手段とを備えた
     ことを特徴とする位置姿勢推定装置。
    A set of three or more three-dimensional coordinates related to the object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image is input,
    Using the set of the input three-dimensional coordinates and the two-dimensional coordinates, the error is determined with respect to a predetermined error function representing the conversion relationship between the three-dimensional coordinates and the two-dimensional coordinates using a posture of three degrees of freedom as a variable. An optimal solution candidate calculation means for calculating all solutions satisfying the simultaneous polynomial with the function gradient set to zero;
    From all the solutions of the simultaneous polynomial calculated by the optimal solution candidate calculating means, an optimal solution that minimizes the error function is extracted, and the position of the camera that has photographed the object based on the extracted optimal solution A position / orientation estimation apparatus comprising: a position / orientation calculation means for calculating an attitude.
  2.  前記最適解候補計算手段は、
     前記3次元座標と前記2次元座標の組を入力とし、前記連立多項式の係数を計算する係数計算手段と、
     前記係数計算手段によって算出された前記連立多項式の係数を入力とし、前記連立多項式を満たすすべての解を計算する連立多項式求解手段とを含む
     請求項1に記載の位置姿勢推定装置。
    The optimal solution candidate calculation means includes:
    Coefficient calculating means for taking a set of the three-dimensional coordinates and the two-dimensional coordinates as input and calculating a coefficient of the simultaneous polynomial;
    The position / orientation estimation apparatus according to claim 1, further comprising: a simultaneous polynomial solving unit that receives the coefficients of the simultaneous polynomials calculated by the coefficient calculating unit and calculates all solutions satisfying the simultaneous polynomials.
  3.  前記位置姿勢計算手段は、
     前記連立多項式のすべての解の中からすべての実数解を抽出し、抽出したすべての実数解または解なしを示すフラグを出力する実数解抽出手段と、
     前記実数解抽出手段によって抽出されたすべての実数解を、それぞれ1つの姿勢の候補に変換する姿勢候補計算手段と、
     前記姿勢候補計算手段によって変換された姿勢の候補の数と、前記入力された3次元座標と前記2次元座標の組の数である入力点数とに基づき、前記姿勢候補計算手段によって変換されたすべての姿勢の候補の中から、前記誤差関数が最小となる1または複数の姿勢を抽出する誤差最小候補抽出手段と、
     前記誤差最小候補抽出手段によって抽出された前記誤差関数が最小となる1または複数の姿勢に基づき、前記各姿勢に対応する位置を計算し、それぞれ1組の位置姿勢として出力する位置候補計算手段とを含む
     請求項1または請求項2に記載の位置姿勢推定装置。
    The position / orientation calculation means includes:
    Real number solution extracting means for extracting all real number solutions from all solutions of the simultaneous polynomial and outputting a flag indicating all extracted real number solutions or no solution;
    Posture candidate calculation means for converting all the real solutions extracted by the real number solution extraction means into one posture candidate;
    Based on the number of posture candidates converted by the posture candidate calculation means and the number of input points that is the number of sets of the input three-dimensional coordinates and the two-dimensional coordinates, all of the positions converted by the posture candidate calculation means Minimum error candidate extraction means for extracting one or a plurality of postures that minimize the error function from among the posture candidates,
    Position candidate calculation means for calculating a position corresponding to each of the attitudes based on one or a plurality of attitudes with which the error function extracted by the minimum error candidate extracting means is minimized, and outputting each position as a set of position and attitude; The position and orientation estimation apparatus according to claim 1 or 2.
  4.  前記位置姿勢計算手段は、前記実数解抽出手段によって抽出されたすべての実数解のうち、2次最適性十分条件を満たす実数解を計算して、出力する2次最適性検証手段を含み、
     前記姿勢候補計算手段は、前記2次最適性検証手段によって2次最適性十分条件を満たすとされたすべての実数解を、それぞれ1つの姿勢の候補に変換する
     請求項3に記載の位置姿勢推定装置。
    The position / orientation calculation means includes a secondary optimality verification means for calculating and outputting a real number solution satisfying a secondary optimality sufficient condition among all the real number solutions extracted by the real number solution extraction means,
    The position / orientation estimation according to claim 3, wherein the attitude candidate calculation unit converts all real solutions determined to satisfy the second-order optimality sufficient condition by the second-order optimality verification unit into one attitude candidate. apparatus.
  5.  前記入力された3次元座標がカメラの正面にあるか否かを判定し、正面にないと判定された場合に、前記位置姿勢計算手段から出力される位置姿勢を補正するまたはエラーを示すフラグを出力する正面性検証手段を備えた
     請求項1から請求項4のうちのいずれか1項に記載の位置姿勢推定装置。
    It is determined whether or not the input three-dimensional coordinates are in front of the camera. If it is determined that the input three-dimensional coordinates are not in front, a position / orientation output from the position / orientation calculation means is corrected or a flag indicating an error is displayed. The position and orientation estimation apparatus according to any one of claims 1 to 4, further comprising a frontality verification means for outputting.
  6.  前記正面性検証手段は、
     前記3次元座標が平面か非平面かを判別し、判別結果を出力する平面判別手段と、
     前記3次元座標と、前記判別結果と、前記位置姿勢計算手段から出力される位置姿勢とを入力として、前記判別結果が平面であれば、前記3次元座標がカメラの正面にあるか否かを判定し、正面にないと判定された場合に、前記位置姿勢を補正する位置姿勢補正手段とを含む
     請求項5に記載の位置姿勢推定装置。
    The frontality verification means includes
    Plane discriminating means for discriminating whether the three-dimensional coordinates are planar or non-planar and outputting a discrimination result;
    If the three-dimensional coordinates, the determination result, and the position / orientation output from the position / orientation calculation means are input and the determination result is a plane, it is determined whether the three-dimensional coordinates are in front of the camera. The position / orientation estimation apparatus according to claim 5, further comprising: a position / orientation correction unit that corrects the position / orientation when it is determined that the position / orientation is not present.
  7.  3次元座標と2次元座標の組が当該位置姿勢推定装置に入力されると、事前に決定した正規化パラメータまたは前記3次元座標により計算した正規化パラメータに基づき、前記3次元座標を正規化する正規化手段と、
     前記正規化パラメータと、前記正規化された3次元座標を用いて算出された位置姿勢とを入力とし、前記正規化パラメータに基づき逆正規化した位置姿勢を計算して出力する逆正規化手段とを備える
     請求項1から請求項6のうちのいずれか1項に記載の位置姿勢推定装置。
    When a set of 3D coordinates and 2D coordinates is input to the position and orientation estimation apparatus, the 3D coordinates are normalized based on a predetermined normalization parameter or a normalization parameter calculated from the 3D coordinates. Normalization means,
    A denormalization unit that receives the normalization parameter and the position and orientation calculated using the normalized three-dimensional coordinates, and calculates and outputs a denormalized position and orientation based on the normalization parameter; The position / orientation estimation apparatus according to any one of claims 1 to 6.
  8.  対象物に関する3以上の、3次元座標と画像上で前記3次元座標に対応する2次元座標の組を入力として、入力された前記3次元座標と前記2次元座標の組を用いて、3自由度の姿勢を変数として前記3次元座標と前記2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算し、
     算出された前記連立多項式のすべての解の中から、前記誤差関数が最小となる最適解を抽出し、抽出した前記最適解に基づき前記対象物を撮影したカメラの位置姿勢を計算する
     ことを特徴とする位置姿勢推定方法。
    Three or more three-dimensional coordinates related to the object and a set of two-dimensional coordinates corresponding to the three-dimensional coordinates on the image are input, and the set of the three-dimensional coordinates and the two-dimensional coordinates input is used to make three freedoms. With respect to a predetermined error function that represents the transformation relationship between the three-dimensional coordinates and the two-dimensional coordinates using the degree attitude as a variable, calculate all solutions satisfying the simultaneous polynomial with the gradient of the error function being zero,
    An optimal solution that minimizes the error function is extracted from all the solutions of the calculated simultaneous polynomials, and the position and orientation of the camera that captured the object is calculated based on the extracted optimal solution. A position and orientation estimation method.
  9.  コンピュータに、
     入力された対象物に関する3以上の、3次元座標と画像上で前記3次元座標に対応する2次元座標の組を用いて、3自由度の姿勢を変数として前記3次元座標と前記2次元座標の変換関係を表す所定の誤差関数に対して、当該誤差関数の勾配をゼロとした連立多項式を満たすすべての解を計算する処理、および
     算出された前記連立多項式のすべての解の中から、前記誤差関数が最小となる最適解を抽出し、抽出した前記最適解に基づき前記対象物を撮影したカメラの位置姿勢を計算する処理
     を実行させるための位置姿勢推定プログラム。
    On the computer,
    Using a set of three or more three-dimensional coordinates related to the input object and two-dimensional coordinates corresponding to the three-dimensional coordinates on the image, the three-dimensional coordinates and the two-dimensional coordinates with a posture of three degrees of freedom as a variable A process for calculating all solutions satisfying the simultaneous polynomial with the gradient of the error function being zero, and all of the calculated solutions of the simultaneous polynomial A position and orientation estimation program for executing processing for extracting an optimal solution that minimizes an error function and calculating a position and orientation of a camera that has photographed the object based on the extracted optimal solution.
PCT/JP2012/003240 2011-05-20 2012-05-17 Position/posture estimation device, position/posture estimation method and position/posture estimation program WO2012160787A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011-113969 2011-05-20
JP2011113969 2011-05-20

Publications (1)

Publication Number Publication Date
WO2012160787A1 true WO2012160787A1 (en) 2012-11-29

Family

ID=47216880

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/003240 WO2012160787A1 (en) 2011-05-20 2012-05-17 Position/posture estimation device, position/posture estimation method and position/posture estimation program

Country Status (1)

Country Link
WO (1) WO2012160787A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014034035A1 (en) * 2012-08-31 2014-03-06 日本電気株式会社 Location attitude estimation device, location attitude estimation method, and location attitude estimation program
CN110147767A (en) * 2019-05-22 2019-08-20 深圳市凌云视迅科技有限责任公司 Three-dimension gesture attitude prediction method based on two dimensional image

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002063567A (en) * 2000-08-23 2002-02-28 Nec Corp Device and method for estimating body position and attitude, method for feature point extraction method using the same, and image collating method
JP2008286756A (en) * 2007-05-21 2008-11-27 Canon Inc Position attitude measuring device and control method for it
JP3158823U (en) * 2009-12-25 2010-04-22 財団法人日本交通管理技術協会 Reference axis vertical setting device in 3D measurement method using digital camera

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002063567A (en) * 2000-08-23 2002-02-28 Nec Corp Device and method for estimating body position and attitude, method for feature point extraction method using the same, and image collating method
JP2008286756A (en) * 2007-05-21 2008-11-27 Canon Inc Position attitude measuring device and control method for it
JP3158823U (en) * 2009-12-25 2010-04-22 財団法人日本交通管理技術協会 Reference axis vertical setting device in 3D measurement method using digital camera

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RICHARD HARTLEY ET AL.: "Optimal Algorithms in Multiview Geometry", ACCV'07 PROCEEDINGS OF THE 8TH ASIAN CONFERENCE ON COMPUTER VISION, 2007, pages 13 - 34 *
YASUYUKI SUGAYA ET AL.: "Optimization Computation for 3-D Understanding of Images [IV-Finish]", THE JOURNAL OF THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS, vol. 92, no. 7, 1 July 2009 (2009-07-01), pages 573 - 578 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014034035A1 (en) * 2012-08-31 2014-03-06 日本電気株式会社 Location attitude estimation device, location attitude estimation method, and location attitude estimation program
JPWO2014034035A1 (en) * 2012-08-31 2016-08-08 日本電気株式会社 Position / orientation estimation apparatus, position / orientation estimation method, and position / orientation estimation program
CN110147767A (en) * 2019-05-22 2019-08-20 深圳市凌云视迅科技有限责任公司 Three-dimension gesture attitude prediction method based on two dimensional image
CN110147767B (en) * 2019-05-22 2023-07-18 深圳市凌云视迅科技有限责任公司 Three-dimensional gesture attitude prediction method based on two-dimensional image

Similar Documents

Publication Publication Date Title
Penate-Sanchez et al. Exhaustive linearization for robust camera pose and focal length estimation
EP2466543B1 (en) Position and orientation measurement device and position and orientation measurement method
US9153030B2 (en) Position and orientation estimation method and apparatus therefor
JP5406705B2 (en) Data correction apparatus and method
CN110648361A (en) Real-time pose estimation method and positioning and grabbing system of three-dimensional target object
US20140300597A1 (en) Method for the automated identification of real world objects
EP3166074A1 (en) Method of camera calibration for a multi-camera system and apparatus performing the same
CN108335327B (en) Camera attitude estimation method and camera attitude estimation device
Ma et al. Mismatch removal via coherent spatial mapping
Martins et al. Non-parametric bayesian constrained local models
Chen et al. Nonconvex plus quadratic penalized low-rank and sparse decomposition for noisy image alignment
CN108335328B (en) Camera attitude estimation method and camera attitude estimation device
WO2012160787A1 (en) Position/posture estimation device, position/posture estimation method and position/posture estimation program
KR101184588B1 (en) A method and apparatus for contour-based object category recognition robust to viewpoint changes
Bruns et al. On the evaluation of RGB-D-based categorical pose and shape estimation
Wadenbäck et al. Recovering planar motion from homographies obtained using a 2.5-point solver for a polynomial system
EP3089109A1 (en) Method and apparatus for multiple image registration in the gradient domain
Meng et al. Camera motion estimation and optimization approach
JP6260533B2 (en) Position / orientation estimation apparatus, position / orientation estimation method, and position / orientation estimation program
Guo et al. A hybrid framework based on warped hierarchical tree for pose estimation of texture-less objects
US20220050997A1 (en) Method and system for processing an image by determining rotation hypotheses
JP2000353244A (en) Method for obtaining basic matrix, method for restoring euclidean three-dimensional information and device therefor
Yang et al. Optimal hand-eye calibration of imu and camera
Yilmaz et al. Facial feature extraction using a probabilistic approach
JP6604537B2 (en) Keypoint detector, keypoint detection method, and keypoint detection program

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12789134

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP