Skip to content

Commit

Permalink
v1.0.3 MRTKv2 support.
Browse files Browse the repository at this point in the history
Hololens 10.0.17763.914 (RS5)
Windows 10 SDK 10.0.18362.0
Visual Studio 2017 or 2019
Unity 2018.4.7f1+
Microsoft Mixed Reality Toolkit v2.2.0
OpenCVForUnity 2.3.7+
HoloLensCameraStream
  • Loading branch information
EnoxSoftware committed Jan 2, 2020
1 parent d435038 commit ca25664
Show file tree
Hide file tree
Showing 39 changed files with 5,451 additions and 4,295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace HoloLensWithOpenCVForUnityExample
[System.Serializable]
public struct CameraParameters
{
public string calibration_date;
public string calibration_date;
public int frames_count;
public int image_width;
public int image_height;
Expand All @@ -15,9 +15,9 @@ public struct CameraParameters
public double[] distortion_coefficients;
public double avg_reprojection_error;

public CameraParameters (int frames_count, int image_width, int image_height, int calibration_flags, double[] camera_matrix, double[] distortion_coefficients, double avg_reprojection_error)
public CameraParameters(int frames_count, int image_width, int image_height, int calibration_flags, double[] camera_matrix, double[] distortion_coefficients, double avg_reprojection_error)
{
this.calibration_date = DateTime.Now.ToString ();
this.calibration_date = DateTime.Now.ToString();
this.frames_count = frames_count;
this.image_width = image_width;
this.image_height = image_height;
Expand All @@ -27,15 +27,15 @@ public CameraParameters (int frames_count, int image_width, int image_height, in
this.avg_reprojection_error = avg_reprojection_error;
}

public CameraParameters (int frames_count, int image_width, int image_height, int calibration_flags, Mat camera_matrix, Mat distortion_coefficients, double avg_reprojection_error)
public CameraParameters(int frames_count, int image_width, int image_height, int calibration_flags, Mat camera_matrix, Mat distortion_coefficients, double avg_reprojection_error)
{
double[] camera_matrixArr = new double[camera_matrix.total()];
camera_matrix.get (0, 0, camera_matrixArr);
camera_matrix.get(0, 0, camera_matrixArr);

double[] distortion_coefficientsArr = new double[distortion_coefficients.total()];
distortion_coefficients.get (0, 0, distortion_coefficientsArr);
distortion_coefficients.get(0, 0, distortion_coefficientsArr);

this.calibration_date = DateTime.Now.ToString ();
this.calibration_date = DateTime.Now.ToString();
this.frames_count = frames_count;
this.image_width = image_width;
this.image_height = image_height;
Expand All @@ -45,17 +45,17 @@ public CameraParameters (int frames_count, int image_width, int image_height, in
this.avg_reprojection_error = avg_reprojection_error;
}

public Mat GetCameraMatrix ()
public Mat GetCameraMatrix()
{
Mat m = new Mat (3, 3, CvType.CV_64FC1);
m.put (0, 0, camera_matrix);
Mat m = new Mat(3, 3, CvType.CV_64FC1);
m.put(0, 0, camera_matrix);
return m;
}

public Mat GetDistortionCoefficients ()
public Mat GetDistortionCoefficients()
{
Mat m = new Mat (distortion_coefficients.Length, 1, CvType.CV_64FC1);
m.put (0, 0, distortion_coefficients);
Mat m = new Mat(distortion_coefficients.Length, 1, CvType.CV_64FC1);
m.put(0, 0, distortion_coefficients);
return m;
}
}
Expand Down
Loading

0 comments on commit ca25664

Please sign in to comment.