public MainWindow() { InitializeComponent(); bitmap = new WriteableBitmap(VGACameraWidth, VGACameraHeight, 92, 92, PixelFormats.Bgr24, null); calibrator = new Calibrator(new OpenCvSharp.CPlusPlus.Size((int)ImageWidthStandard, (int)ImageHeightStandard), new OpenCvSharp.CPlusPlus.Size(10, 7)); }
public async Task <IActionResult> PutCalibrator(int id, Calibrator calibrator) { if (id != calibrator.Id) { return(BadRequest()); } _context.Entry(calibrator).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CalibratorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
static void Main() { try { var zivid = new Zivid.NET.Application(); Console.WriteLine("Connecting to camera"); var camera = zivid.ConnectCamera(); var inputs = ReadInputs(camera); Console.WriteLine("Performing hand-eye calibration"); var calibrationResult = Calibrator.CalibrateEyeToHand(inputs); if (calibrationResult) { Console.WriteLine("{0}\n{1}\n{2}", "Hand-eye calibration OK", "Result:", calibrationResult); } else { Console.WriteLine("Hand-eye calibration FAILED"); Environment.ExitCode = 1; } } catch (Exception ex) { Console.WriteLine("Error: {0}", ex.Message); Environment.ExitCode = 1; } }
public async Task <ActionResult <Calibrator> > PostCalibrator(Calibrator calibrator) { _context.Calibrators.Add(calibrator); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCalibrator), new { id = calibrator.Id }, calibrator)); }
public static void Run(string[] args) { var xefPath = @"C:\XEF\cam2_cal.xef"; var xef = new Xef(xefPath); //Load computer vision (CV) color file var colorCV = xef.LoadCvColorFrame(0); colorCV.DrawAruco().ShowNoWait(); var cameraSpace = xef.LoadCVCameraSpace(2); var(tx, markers) = Calibrator.Calibrate(colorCV, cameraSpace); var pose = tx .CameraSpaceToWorldTx .ToMat(); var camSpaceTx = cameraSpace.Transform(pose) .ToCamSpacePoints(); //Save as XYZRGB file (open in MeshLab to view) XYZRGB.Export(camSpaceTx, colorCV.GetBRGABytes(), @"C:\XEF\cam2_cal.txt"); markers = markers.OrderByDescending(m => m.MaskSum.Val0).Take(4).ToList(); var markerPoints = new CvCameraSpace(); markers.ForEach(m => markerPoints.Add(m.KxCenter)); var txMarkers = markerPoints.Transform(pose); XYZRGB.Export(txMarkers, new Scalar(255, 0, 0), @"C:\XEF\cam2_cal_markers.txt"); }
internal override DoubleArray computedBucketedCs01(ResolvedCdsTrade trade, IList <ResolvedCdsTrade> bucketCds, CreditRatesProvider ratesProvider, ReferenceData refData) { checkCdsBucket(trade, bucketCds); ResolvedCds product = trade.Product; Currency currency = product.Currency; StandardId legalEntityId = product.LegalEntityId; LocalDate valuationDate = ratesProvider.ValuationDate; int nBucket = bucketCds.Count; DoubleArray impSp = impliedSpread(bucketCds, ratesProvider, refData); NodalCurve creditCurveBase = Calibrator.calibrate(bucketCds, impSp, DoubleArray.filled(nBucket), CurveName.of("baseImpliedCreditCurve"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); IsdaCreditDiscountFactors df = IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurveBase); CreditRatesProvider ratesProviderBase = ratesProvider.toImmutableCreditRatesProvider().toBuilder().creditCurves(ImmutableMap.of(Pair.of(legalEntityId, currency), LegalEntitySurvivalProbabilities.of(legalEntityId, df))).build(); double[][] res = new double[nBucket][]; PointSensitivities pointPv = Pricer.presentValueOnSettleSensitivity(trade, ratesProviderBase, refData); DoubleArray vLambda = ratesProviderBase.singleCreditCurveParameterSensitivity(pointPv, legalEntityId, currency).Sensitivity; for (int i = 0; i < nBucket; i++) { PointSensitivities pointSp = Pricer.parSpreadSensitivity(bucketCds[i], ratesProviderBase, refData); res[i] = ratesProviderBase.singleCreditCurveParameterSensitivity(pointSp, legalEntityId, currency).Sensitivity.toArray(); } DoubleMatrix jacT = MATRIX_ALGEBRA.getTranspose(DoubleMatrix.ofUnsafe(res)); LUDecompositionResult luRes = DECOMPOSITION.apply(jacT); DoubleArray vS = luRes.solve(vLambda); return(vS); }
internal override DoubleArray computedBucketedCs01(ResolvedCdsTrade trade, IList <ResolvedCdsTrade> bucketCds, CreditRatesProvider ratesProvider, ReferenceData refData) { checkCdsBucket(trade, bucketCds); ResolvedCds product = trade.Product; Currency currency = product.Currency; StandardId legalEntityId = product.LegalEntityId; LocalDate valuationDate = ratesProvider.ValuationDate; ImmutableCreditRatesProvider immutableRatesProvider = ratesProvider.toImmutableCreditRatesProvider(); int nBucket = bucketCds.Count; double[] res = new double[nBucket]; DoubleArray impSp = impliedSpread(bucketCds, ratesProvider, refData); NodalCurve creditCurveBase = Calibrator.calibrate(bucketCds, impSp, DoubleArray.filled(nBucket), CurveName.of("baseImpliedCreditCurve"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); Pair <StandardId, Currency> lePair = Pair.of(legalEntityId, currency); IsdaCreditDiscountFactors df = IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurveBase); CreditRatesProvider ratesProviderBase = immutableRatesProvider.toBuilder().creditCurves(ImmutableMap.of(lePair, LegalEntitySurvivalProbabilities.of(legalEntityId, df))).build(); double pvBase = Pricer.presentValueOnSettle(trade, ratesProviderBase, PriceType.DIRTY, refData).Amount; for (int i = 0; i < nBucket; ++i) { double[] bumpedSp = impSp.toArray(); bumpedSp[i] += bumpAmount; NodalCurve creditCurveBump = Calibrator.calibrate(bucketCds, DoubleArray.ofUnsafe(bumpedSp), DoubleArray.filled(nBucket), CurveName.of("bumpedImpliedCreditCurve"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); IsdaCreditDiscountFactors dfBump = IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurveBump); CreditRatesProvider ratesProviderBump = immutableRatesProvider.toBuilder().creditCurves(ImmutableMap.of(lePair, LegalEntitySurvivalProbabilities.of(legalEntityId, dfBump))).build(); double pvBumped = Pricer.presentValueOnSettle(trade, ratesProviderBump, PriceType.DIRTY, refData).Amount; res[i] = (pvBumped - pvBase) / bumpAmount; } return(DoubleArray.ofUnsafe(res)); }
/// <summary> /// 反应进程编号(下拉框改变事件) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboBoxEditCuveNum_SelectedIndexChanged(object sender, EventArgs e) { //根据下拉框选择的比色表编号更新对应的校准信息 //TimeCourseInfo timecuvno = new TimeCourseInfo(); int tcno = 0; string strCalibrationDT = ""; int TestNum = 0; foreach (CalibrationResultinfo calib in lstCalibrationResultInfo) { if (comboBoxCalibTime.Text == calib.CalibrationDT.ToString() && comBoxEditCalibName.Text == calib.CalibratorName) { TestNum++; } if (comBoxEditCalibName.Text == calib.CalibratorName && Convert.ToInt32(comBoxProcessNumValue.Text) == calib.TCNO && comboBoxCalibTime.Text == calib.CalibrationDT.ToString()) { tcno = calib.TCNO; strCalibrationDT = calib.CalibrationDT.ToString("yyyy-MM-dd"); } } comboBoxNum.Text = TestNum.ToString(); this.comBoxEditCalibName.Enabled = false; this.comboBoxCalibTime.Enabled = false; this.comBoxProcessNumValue.Enabled = false; //if (CalibrationTimeCoursetEvent != null) //{ // CalibrationTimeCoursetEvent(new Dictionary<string, object[]>() { { "QueryCalibrationReactionProcess", new object[] { XmlUtility.Serializer(typeof(TimeCourseInfo), timecuvno) } } }); //} TimeCourseInfo timeCourseInfoResult = new Calibrator().QueryCalibrationReactionProcess("QueryCalibrationReactionProcess", tcno, strCalibrationDT); this.SampleReactionInfo = timeCourseInfoResult; }
//------------------------------------------------------------------------- public override CurrencyAmount parallelCs01(ResolvedCdsTrade trade, IList <ResolvedCdsTrade> bucketCds, CreditRatesProvider ratesProvider, ReferenceData refData) { checkCdsBucket(trade, bucketCds); ResolvedCds product = trade.Product; Currency currency = product.Currency; StandardId legalEntityId = product.LegalEntityId; LocalDate valuationDate = ratesProvider.ValuationDate; ImmutableCreditRatesProvider immutableRatesProvider = ratesProvider.toImmutableCreditRatesProvider(); int nBucket = bucketCds.Count; DoubleArray impSp = impliedSpread(bucketCds, ratesProvider, refData); NodalCurve creditCurveBase = Calibrator.calibrate(bucketCds, impSp, DoubleArray.filled(nBucket), CurveName.of("baseImpliedCreditCurve"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); Pair <StandardId, Currency> lePair = Pair.of(legalEntityId, currency); IsdaCreditDiscountFactors df = IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurveBase); CreditRatesProvider ratesProviderBase = immutableRatesProvider.toBuilder().creditCurves(ImmutableMap.of(lePair, LegalEntitySurvivalProbabilities.of(legalEntityId, df))).build(); CurrencyAmount pvBase = Pricer.presentValueOnSettle(trade, ratesProviderBase, PriceType.DIRTY, refData); DoubleArray bumpedSp = DoubleArray.of(nBucket, i => impSp.get(i) + bumpAmount); NodalCurve creditCurveBump = Calibrator.calibrate(bucketCds, bumpedSp, DoubleArray.filled(nBucket), CurveName.of("bumpedImpliedCreditCurve"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); IsdaCreditDiscountFactors dfBump = IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurveBump); CreditRatesProvider ratesProviderBump = immutableRatesProvider.toBuilder().creditCurves(ImmutableMap.of(lePair, LegalEntitySurvivalProbabilities.of(legalEntityId, dfBump))).build(); CurrencyAmount pvBumped = Pricer.presentValueOnSettle(trade, ratesProviderBump, PriceType.DIRTY, refData); return(CurrencyAmount.of(currency, (pvBumped.Amount - pvBase.Amount) / bumpAmount)); }
public SimpleComponent(byte boardID, int byteSize, bool signed, string name, string logHeader, Calibrator calibrator) : base(boardID, null, name) { _logHeader = logHeader; Signed = signed; ByteSize = byteSize; _calibrator = calibrator; }
private void panel6_Paint(object sender, PaintEventArgs e) { try { int w = panel6.Width - 20; int h = panel6.Height - 20; if (listLines.SelectedIndex < 0 || w <= 0 || h <= 0) { e.Graphics.DrawString("No data", DefaultFont, Brushes.Black, 40, 40); return; } Calibrator cal = Calibrations[listLines.SelectedIndex]; //if(cal.DltAnalit == 0 || cal.DltCon == 0) double kx = cal.DltCon / w; double ky = cal.DltAnalit / h; for (int i = 0; i < cal.Con.Length; i++) { int x = 10 + (int)((cal.Con[i] - cal.MinCon) / kx); int y = panel6.Height - (int)((cal.Analit[i] - cal.MinAnalit) / ky) - 10; e.Graphics.DrawLine(Pens.Red, x, y - 10, x, y + 10); e.Graphics.DrawLine(Pens.Red, x - 5, y, x + 5, y); } } catch (Exception ex) { Common.LogNoMsg(ex); } }
static void Main() { try { Console.WriteLine("Finding cameras"); var zivid = new Zivid.NET.Application(); var cameras = zivid.Cameras; Console.WriteLine("Number of cameras found: {0}", cameras.Count); foreach (var camera in cameras) { Console.WriteLine("Connecting to camera: {0}", camera.Info.SerialNumber); camera.Connect(); } var detectionResults = new List <DetectionResult>(); foreach (var camera in cameras) { Console.WriteLine("Capturing frame with camera: {0}", camera.Info.SerialNumber); using (var frame = AssistedCapture(camera)) { Console.WriteLine("Detecting checkerboard in point cloud"); var detectionResult = Detector.DetectFeaturePoints(frame.PointCloud); if (detectionResult) { detectionResults.Add(detectionResult); } else { throw new System.InvalidOperationException( "Could not detect checkerboard. Please ensure it is visible from all cameras."); } } } Console.WriteLine("Performing Multi-camera calibration"); var result = Calibrator.CalibrateMultiCamera(detectionResults); if (result) { Console.WriteLine("Multi-camera calibration OK."); var transforms = result.Transforms(); var residuals = result.Residuals(); for (int i = 0; i < transforms.Length; i++) { PrintMatrix(transforms[i]); Console.WriteLine(residuals[i] .ToString()); } } else { Console.WriteLine("Multi-camera calibration FAILED."); } } catch (Exception ex) { Console.WriteLine("Error: {0}", ex.Message); Environment.ExitCode = 1; } }
void Start() { calibrator = FindObjectOfType <Calibrator> (); if (!calibrator) { Debug.LogError("Calibrator not found in " + name); } }
public void CalibrationCurve_Load(object sender, EventArgs e) { this.lisCalibrationCurve.Clear(); comBoxEditCalibTime.Properties.Items.Clear(); Calibrator calibrator = new Calibrator(); SelectedlistCalibrationCurve(calibrator.QueryCalibrationCurveInfo("QueryCalibrationCurveInfo", calibrationCurveStateInfo)); }
public void ReactionProcessCB_Load(object sender, EventArgs e) { lstCalibrationResultInfo.Clear(); comBoxEditCalibName.Properties.Items.Clear(); comboBoxCalibTime.Properties.Items.Clear(); Calibrator calibrator = new Calibrator(); calibrationResultInfoAndTimeCUVNOAdd(calibrator.QueryCalibrationResultInfoAndTimeCUVNO("QueryCalibrationResultInfoAndTimeCUVNO", calibrationResult)); }
public Point StartCalibration() { calibrator = new Calibrator(screenWidth, screenHeight); //Guardo el último estado de la calibración wasCalibrated = isCalibrated; isCalibrated = false; calibrating = true; return(new Point(calibrator.GetX(), calibrator.GetY())); }
public int SolutionPart1(params string[] input) { var i = Instructions.Parse(input); var c = new Calibrator(i); var molecules = c.GetDistinctCalibrationMolecules(); return(molecules.Count()); }
public int SolutionPart1(params string[] input) { var i = Instructions.Parse(input); var c = new Calibrator(i); var molecules = c.GetDistinctCalibrationMolecules(); return molecules.Count(); }
public void CalculatorZTest() { var pts = GeneratePostAndTouch(); var lines = Calibrator.MapPointsOnSameLine(pts); Assert.IsTrue(lines.Count == 5); var result = Calibrator.CalculatorZ(lines); Assert.IsTrue(1 == 1); }
public SettingsCustomTabControl() { InitializeComponent(); initBubbels(); textBlockScreenShotsPath.Text = TheBoardApp.MainWindow.ScreenShotsFolder; m_WiiMoteWrapper = new WiiMoteWrapper(); m_Calibrator = new Calibrator(m_WiiMoteWrapper); m_Calibrator.CalibrateFinishedEvent += onCalibrationFinished; labelWiiConnectStatus.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left; labelWiiConnectStatus.Content = ""; }
public void Initialize() { if (FocusSizeFromCenter == null) { Reset(); } #if UNITY_EDITOR || DEVELOPMENT_BUILD VISFixationEnds.Add("discard", new List <Fixation>()); VISFixationEnds.Add("out of range", new List <Fixation>()); VISFixationEnds.Add("microsleep", new List <Fixation>()); VISFixationEnds.Add("off transform", new List <Fixation>()); var viewer = FindObjectOfType <FixationVisualizer>(); if (viewer != null) { viewer.SetTarget(this); } var saccade = FindObjectOfType <SaccadeDrawer>(); if (saccade != null) { saccade.SetTarget(this); } //gameObject.AddComponent<FixationVisualizer>().SetTarget(this); if (DebugMaterial != null) { lastEyeTrackingPointer = GameObject.CreatePrimitive(PrimitiveType.Sphere); lastEyeTrackingPointer.transform.localScale = Vector3.one * 0.2f; lastEyeTrackingPointer.GetComponent <MeshRenderer>().material = DebugMaterial; Destroy(lastEyeTrackingPointer.GetComponent <SphereCollider>()); } #endif ActiveFixation = new Fixation(); for (int i = 0; i < CachedEyeCaptures; i++) { EyeCaptures[i] = new EyeCapture() { Discard = true }; } #if CVR_FOVE fovebase = FindObjectOfType <FoveInterfaceBase>(); #elif CVR_TOBIIVR if (EyeTracker == null) { EyeTracker = FindObjectOfType <Tobii.Research.Unity.VREyeTracker>(); } #elif CVR_AH ah_calibrator = Calibrator.Instance; eyetracker = EyeTracker.Instance; #endif }
private void panel7_Paint(object sender, PaintEventArgs e) { try { int w = panel7.Width / 2; int h = panel7.Height; if (listLines.SelectedIndex < 0 || w <= 0 || h <= 0) { e.Graphics.DrawString("No data", DefaultFont, Brushes.Black, 40, 40); return; } e.Graphics.DrawLine(Pens.Black, w / 2, 0, w / 2, panel7.Height); e.Graphics.DrawLine(Pens.Black, w / 2 + w, 0, w / 2 + w, panel7.Height); Calibrator cal = Calibrations[listLines.SelectedIndex]; double kx = (double)cal.Profile1[0].Length / (double)w; double ky = (double)(numMaxValue.Value) / (double)h; for (int p = 0; p < cal.Profile1.Length; p++) { int xprev = 0; int yprev = h - (int)(cal.Profile1[p][0] / ky); for (int i = 1; i < cal.Profile1[p].Length; i++) { int x = (int)(i / kx); int y = h - (int)(cal.Profile1[p][i] / ky); e.Graphics.DrawLine(Pens.Red, xprev, yprev, x, yprev); e.Graphics.DrawLine(Pens.Red, x, yprev, x, y); xprev = x; yprev = y; } xprev = w; yprev = h - (int)(cal.Profile2[p][0] / ky); for (int i = 1; i < cal.Profile2[p].Length; i++) { int x = w + (int)(i / kx); int y = h - (int)(cal.Profile2[p][i] / ky); e.Graphics.DrawLine(Pens.Blue, xprev, yprev, x, yprev); e.Graphics.DrawLine(Pens.Blue, x, yprev, x, y); xprev = x; yprev = y; } } } catch (Exception ex) { Common.LogNoMsg(ex); } }
public override string SerializeResponse() { StringBuilder builder = new StringBuilder(); builder.AppendLine("WRITE CALIBRATION"); builder.AppendFormat("Record : {0}", Calibrator.ToString()); builder.AppendLine(); builder.AppendFormat("Calibration : {0}*x + {1}", A, B); builder.AppendLine(); builder.AppendFormat("Checksum : {0}", Checksum); builder.AppendLine(); return(builder.ToString()); }
// Use this for initialization private void OnEnable() { tsCam = GameObject.Find ("TS Camera"); blobDebug = tsCam.GetComponent<ftlBlobDebugger> (); calibrator = tsCam.GetComponent<Calibrator> (); initialTableScale = GameObject.Find ("TouchSurface").transform.localScale; if (TouchManager.Instance != null) { TouchManager.Instance.TouchesBegan += touchesBeganHandler; TouchManager.Instance.TouchesEnded += touchesEndedHandler; TouchManager.Instance.TouchesMoved += touchesMovedHandler; TouchManager.Instance.TouchesCancelled += touchesCancelledHandler; } }
private void mainWindow_SizeChanged(object sender, SizeChangedEventArgs e) { if (IsMaximized) { this.PreviewImage.Width = mainGrid.ActualWidth; this.PreviewImage.Height = mainGrid.ActualHeight; calibrator = new Calibrator(new OpenCvSharp.CPlusPlus.Size((int)mainGrid.ActualWidth, (int)mainGrid.ActualHeight), new OpenCvSharp.CPlusPlus.Size(10, 7)); } else { this.PreviewImage.Width = ImageWidthStandard; this.PreviewImage.Height = ImageHeightStandard; calibrator = new Calibrator(new OpenCvSharp.CPlusPlus.Size((int)mainGrid.ActualWidth, (int)mainGrid.ActualHeight), new OpenCvSharp.CPlusPlus.Size(10, 7)); } }
public static void Run() { var xefPath = @"C:\XEF\cam1_cal.xef"; var xef = new Xef(xefPath); //Load computer vision (CV) color file var colorCV = xef.LoadCvColorFrame(0); var cameraSpace = xef.LoadCVCameraSpace(0); var pose = Calibrator.Calibrate(colorCV, cameraSpace) .Transform .CameraSpaceToWorldTx .ToMat(); cameraSpace.Transform(pose); //Save as XYZRGB file (open in MeshLab to view) XYZRGB.Export(cameraSpace.ToCamSpacePoints(), colorCV.GetBRGABytes(), @"C:\XEF\cam1_cal.txt"); }
public override void OnInspectorGUI() { Calibrator myScript = (Calibrator)target; if (GUILayout.Button("Empty calibrator")) { myScript.CleanCalibrator(); } DrawDefaultInspector(); if (GUILayout.Button("Setup screen")) { //Undo.RecordObject(target, "test"); myScript.SetupCalibrator(); } }
public override string SerializeResponse() { StringBuilder builder = new StringBuilder(); builder.AppendLine("READ CALIBRATION"); builder.AppendFormat("Record : {0} ({1})", Calibrator.ToString(), ValidMarker); builder.AppendLine(); if (ValidMarker) { builder.AppendFormat("Calibration : {0}*x + {1}", A, B); builder.AppendLine(); builder.AppendFormat("Checksum : {0}", Checksum); builder.AppendLine(); } return(builder.ToString()); }
private void NewImage(object sender, NewImageEventArgs e) { //if (PenPositionChanged != null) PenPositionChanged(this, PenTracker.GetPenPosition(e.NewImage)); _gridcheck--; if (_gridcheck == 0) // calibration check needed { _gridcheck = 1000; switch (_calibrator.CheckCalibration()) { case 1: Calibrator.Calibrate(); break; case 2: Calibrator.CalibrateColors(); break; } } }
//called immediately after construction public virtual void Initialize() { #if CVR_STEAMVR CognitiveVR_Manager.PoseEvent += CognitiveVR_Manager_OnPoseEvent; //1.2 #endif #if CVR_OCULUS OVRManager.HMDMounted += OVRManager_HMDMounted; OVRManager.HMDUnmounted += OVRManager_HMDUnmounted; #endif string hmdname = "none"; #if CVR_FOVE hmdname = "fove"; #elif CVR_ARKIT hmdname = "arkit"; #elif CVR_ARCORE hmdname = "arcore"; #elif CVR_META hmdname = "meta"; #elif UNITY_2019_1_OR_NEWER string rawHMDName = UnityEngine.XR.InputDevices.GetDeviceAtXRNode(UnityEngine.XR.XRNode.Head).name; //string rawHMDName = UnityEngine.XR.XRDevice.model.ToLower(); hmdname = CognitiveVR.Util.GetSimpleHMDName(rawHMDName); #elif UNITY_2017_2_OR_NEWER string rawHMDName = UnityEngine.XR.XRDevice.model.ToLower(); hmdname = CognitiveVR.Util.GetSimpleHMDName(rawHMDName); #else string rawHMDName = UnityEngine.VR.VRDevice.model.ToLower(); hmdname = CognitiveVR.Util.GetSimpleHMDName(rawHMDName); #endif #if CVR_AH ah_calibrator = Calibrator.Instance; #endif #if CVR_PUPIL gazeController = FindObjectOfType <PupilLabs.GazeController>(); if (gazeController != null) { gazeController.OnReceive3dGaze += ReceiveEyeData; } else { Debug.LogError("Pupil Labs GazeController is null!"); } #endif GazeCore.SetHMDType(hmdname); cameraRoot = GameplayReferences.HMD.root; }
public Boolean LoadCalibration() { try { CalibrationData data = CalibrationPersister.LoadCalibrationData(); if (calibrator == null) { calibrator = new Calibrator(screenWidth, screenHeight); } calibrator.Calibrate(data); isCalibrated = true; return(true); } catch (CalibrationDataNotFoundException) { return(false); } }
private void CalibrationMaintainLoad() { Calibrator calibrator = new Calibrator(); //calibMainDictionary.Clear(); //获取所有校准品对应的所有项目信息 //calibMainDictionary.Add("QueryCalibratorProjectinfo", new object[] { "" }); calibratorProjectinfo = calibrator.QueryCalibratorProjectinfo("QueryCalibratorProjectinfo", ""); //获取所有校准品信息 //calibMainDictionary.Add("QueryCalibrationMaintain", new object[] { "" }); calibratorinfo = calibrator.QueryCalibratorinfo("QueryCalibrationMaintain", ""); DisplayCalibrationInfo(calibratorinfo); //获取所有生化项目信息 //calibMainDictionary.Add("QueryAssayProAllInfo", null); lisassayProjectInfo = new SettingsChemicalParameter().QueryAssayProAllInfo("QueryAssayProAllInfo", null); //获取所有校准品位置 //calibMainDictionary.Add("QueryCalibPos", new object[] { "" }); //CalibrationMaintainSend(calibMainDictionary); }