private bool solveHomography4PointsInhomogenous(NyARDoubleMatrix33 i_homography_mat, NyARDoublePoint2d x1, NyARDoublePoint2d x2, NyARDoublePoint2d x3, NyARDoublePoint2d x4, NyARDoublePoint2d xp1, NyARDoublePoint2d xp2, NyARDoublePoint2d xp3, NyARDoublePoint2d xp4) { double[][] _mat_A = ArrayUtils.newDouble2dArray(8, 9); // x1.setValue(0, 0);x2.setValue(10, 0);x3.setValue(10, 10);x4.setValue(0, 10); // xp1.setValue(10, 10);xp2.setValue(10, 0);xp3.setValue(0, 0);xp4.setValue(0, 10); //Homography4PointsInhomogeneousConstraint AddHomographyPointContraint(_mat_A, 0, x1, xp1); AddHomographyPointContraint(_mat_A, 2, x2, xp2); AddHomographyPointContraint(_mat_A, 4, x3, xp3); AddHomographyPointContraint(_mat_A, 6, x4, xp4); //SolveHomography4PointsInhomogenous if (!this.solveNullVector8x9Destructive(i_homography_mat, _mat_A)) { return(false); } if (Math.Abs(i_homography_mat.determinant()) < 1e-5) { return(false); } return(true); }
private bool solveHomography4PointsInhomogenous(NyARDoubleMatrix33 i_homography_mat) { //SolveHomography4PointsInhomogenous if (!this.solveNullVector8x9Destructive(i_homography_mat, this._mat_A)) { return(false); } if (Math.Abs(i_homography_mat.determinant()) < 1e-5) { return(false); } return(true); }