-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.0.5 Support for Hololens1 and Hololens2. (XR System: Legacy Built-…
…in XR / XR Plugin Management WindowsMR / XR Plugin Management OpenXR) This closes #47, closes #45, closes #44, closes #43, closes #42, closes #36, closes #29 .
- Loading branch information
1 parent
438b027
commit 430cad4
Showing
93 changed files
with
9,832 additions
and
12,897 deletions.
There are no files selected for viewing
File renamed without changes.
124 changes: 62 additions & 62 deletions
124
.../HoloLensArUcoExample/CameraParameters.cs → ...xample/HLArUcoExample/CameraParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
using System; | ||
using OpenCVForUnity.CoreModule; | ||
|
||
namespace HoloLensWithOpenCVForUnityExample | ||
{ | ||
[System.Serializable] | ||
public struct CameraParameters | ||
{ | ||
public string calibration_date; | ||
public int frames_count; | ||
public int image_width; | ||
public int image_height; | ||
public int calibration_flags; | ||
public double[] camera_matrix; | ||
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) | ||
{ | ||
this.calibration_date = DateTime.Now.ToString(); | ||
this.frames_count = frames_count; | ||
this.image_width = image_width; | ||
this.image_height = image_height; | ||
this.calibration_flags = calibration_flags; | ||
this.camera_matrix = camera_matrix; | ||
this.distortion_coefficients = distortion_coefficients; | ||
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) | ||
{ | ||
double[] camera_matrixArr = new double[camera_matrix.total()]; | ||
camera_matrix.get(0, 0, camera_matrixArr); | ||
|
||
double[] distortion_coefficientsArr = new double[distortion_coefficients.total()]; | ||
distortion_coefficients.get(0, 0, distortion_coefficientsArr); | ||
|
||
this.calibration_date = DateTime.Now.ToString(); | ||
this.frames_count = frames_count; | ||
this.image_width = image_width; | ||
this.image_height = image_height; | ||
this.calibration_flags = calibration_flags; | ||
this.camera_matrix = camera_matrixArr; | ||
this.distortion_coefficients = distortion_coefficientsArr; | ||
this.avg_reprojection_error = avg_reprojection_error; | ||
} | ||
|
||
public Mat GetCameraMatrix() | ||
{ | ||
Mat m = new Mat(3, 3, CvType.CV_64FC1); | ||
m.put(0, 0, camera_matrix); | ||
return m; | ||
} | ||
|
||
public Mat GetDistortionCoefficients() | ||
{ | ||
Mat m = new Mat(distortion_coefficients.Length, 1, CvType.CV_64FC1); | ||
m.put(0, 0, distortion_coefficients); | ||
return m; | ||
} | ||
} | ||
} | ||
using System; | ||
using OpenCVForUnity.CoreModule; | ||
|
||
namespace HoloLensWithOpenCVForUnityExample | ||
{ | ||
[System.Serializable] | ||
public struct CameraParameters | ||
{ | ||
public string calibration_date; | ||
public int frames_count; | ||
public int image_width; | ||
public int image_height; | ||
public int calibration_flags; | ||
public double[] camera_matrix; | ||
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) | ||
{ | ||
this.calibration_date = DateTime.Now.ToString(); | ||
this.frames_count = frames_count; | ||
this.image_width = image_width; | ||
this.image_height = image_height; | ||
this.calibration_flags = calibration_flags; | ||
this.camera_matrix = camera_matrix; | ||
this.distortion_coefficients = distortion_coefficients; | ||
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) | ||
{ | ||
double[] camera_matrixArr = new double[camera_matrix.total()]; | ||
camera_matrix.get(0, 0, camera_matrixArr); | ||
|
||
double[] distortion_coefficientsArr = new double[distortion_coefficients.total()]; | ||
distortion_coefficients.get(0, 0, distortion_coefficientsArr); | ||
|
||
this.calibration_date = DateTime.Now.ToString(); | ||
this.frames_count = frames_count; | ||
this.image_width = image_width; | ||
this.image_height = image_height; | ||
this.calibration_flags = calibration_flags; | ||
this.camera_matrix = camera_matrixArr; | ||
this.distortion_coefficients = distortion_coefficientsArr; | ||
this.avg_reprojection_error = avg_reprojection_error; | ||
} | ||
|
||
public Mat GetCameraMatrix() | ||
{ | ||
Mat m = new Mat(3, 3, CvType.CV_64FC1); | ||
m.put(0, 0, camera_matrix); | ||
return m; | ||
} | ||
|
||
public Mat GetDistortionCoefficients() | ||
{ | ||
Mat m = new Mat(distortion_coefficients.Length, 1, CvType.CV_64FC1); | ||
m.put(0, 0, distortion_coefficients); | ||
return m; | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.