Skip to content

Commit d250e38

Browse files
committed
fix.
1 parent 27abfc5 commit d250e38

File tree

137 files changed

+49885
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+49885
-1
lines changed

HoloLensWithOpenCVForUnityExampleMRTK2/Assets/HoloLensWithOpenCVForUnityExample.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HoloLensWithOpenCVForUnityExampleMRTK2/Assets/HoloLensWithOpenCVForUnityExample/HLArUcoExample.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using OpenCVForUnity.CoreModule;
2+
using System;
3+
4+
namespace HoloLensWithOpenCVForUnityExample
5+
{
6+
[System.Serializable]
7+
public struct CameraParameters
8+
{
9+
public string calibration_date;
10+
public int frames_count;
11+
public int image_width;
12+
public int image_height;
13+
public int calibration_flags;
14+
public double[] camera_matrix;
15+
public double[] distortion_coefficients;
16+
public double avg_reprojection_error;
17+
18+
public CameraParameters(int frames_count, int image_width, int image_height, int calibration_flags, double[] camera_matrix, double[] distortion_coefficients, double avg_reprojection_error)
19+
{
20+
this.calibration_date = DateTime.Now.ToString();
21+
this.frames_count = frames_count;
22+
this.image_width = image_width;
23+
this.image_height = image_height;
24+
this.calibration_flags = calibration_flags;
25+
this.camera_matrix = camera_matrix;
26+
this.distortion_coefficients = distortion_coefficients;
27+
this.avg_reprojection_error = avg_reprojection_error;
28+
}
29+
30+
public CameraParameters(int frames_count, int image_width, int image_height, int calibration_flags, Mat camera_matrix, Mat distortion_coefficients, double avg_reprojection_error)
31+
{
32+
double[] camera_matrixArr = new double[camera_matrix.total()];
33+
camera_matrix.get(0, 0, camera_matrixArr);
34+
35+
double[] distortion_coefficientsArr = new double[distortion_coefficients.total()];
36+
distortion_coefficients.get(0, 0, distortion_coefficientsArr);
37+
38+
this.calibration_date = DateTime.Now.ToString();
39+
this.frames_count = frames_count;
40+
this.image_width = image_width;
41+
this.image_height = image_height;
42+
this.calibration_flags = calibration_flags;
43+
this.camera_matrix = camera_matrixArr;
44+
this.distortion_coefficients = distortion_coefficientsArr;
45+
this.avg_reprojection_error = avg_reprojection_error;
46+
}
47+
48+
public Mat GetCameraMatrix()
49+
{
50+
Mat m = new Mat(3, 3, CvType.CV_64FC1);
51+
m.put(0, 0, camera_matrix);
52+
return m;
53+
}
54+
55+
public Mat GetDistortionCoefficients()
56+
{
57+
Mat m = new Mat(distortion_coefficients.Length, 1, CvType.CV_64FC1);
58+
m.put(0, 0, distortion_coefficients);
59+
return m;
60+
}
61+
}
62+
}

HoloLensWithOpenCVForUnityExampleMRTK2/Assets/HoloLensWithOpenCVForUnityExample/HLArUcoExample/CameraParameters.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)