/** * @param i_width * パラメータを生成したスクリーンの幅。 * @param i_height * パラメータを生成したスクリーンの高さ。 * @param i_intrinsic_matrix * 3x3 matrix * このパラメータは、OpenCVのcvCalibrateCamera2関数が出力するintrinsic_matrixの値と合致します。 * @param i_distortion_coeffs * 4x1 vector * このパラメータは、OpenCVのcvCalibrateCamera2関数が出力するdistortion_coeffsの値と合致します。 */ public NyARCameraDistortionFactorV4(int i_width, int i_height, double[] i_intrinsic_matrix, double[] i_distortion_coeffs, double i_x_scale, double i_y_scale) { double k1 = i_distortion_coeffs[0]; double k2 = i_distortion_coeffs[1]; double p1 = i_distortion_coeffs[2]; double p2 = i_distortion_coeffs[3]; double fx = i_intrinsic_matrix[0 * 3 + 0]; //0,0 double fy = i_intrinsic_matrix[1 * 3 + 1]; //1,1 double x0 = i_intrinsic_matrix[0 * 3 + 2]; //0,2 double y0 = i_intrinsic_matrix[1 * 3 + 2]; //1,2 //sパラメータを計算するためのスケール1のインスタンス NyARCameraDistortionFactorV4 td = new NyARCameraDistortionFactorV4(new double[] { k1, k2, p1, p2, fx, fy, x0, y0, 1 }, 1, 1); this._k1 = k1; this._k2 = k2; this._p1 = p1; this._p2 = p2; this._fx = fx * i_x_scale; /* fx */ this._fy = fy * i_y_scale; /* fy */ this._x0 = x0 * i_x_scale; /* x0 */ this._y0 = y0 * i_y_scale; /* y0 */ this._s = td.getSizeFactor(x0, y0, i_width, i_height); }
public NyARCameraDistortionFactorV4(NyARCameraDistortionFactorV4 i_copyfrom, double i_x_scale, double i_y_scale) : this(new double[] { i_copyfrom._k1, i_copyfrom._k2, i_copyfrom._p1, i_copyfrom._p2, i_copyfrom._fx, i_copyfrom._fy, i_copyfrom._x0, i_copyfrom._y0, i_copyfrom._s }, i_x_scale, i_y_scale) { return; }