< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Calibration.Components.DepthProcessorBase
Assembly: ReFlex.Core.Calibration
File(s): D:\a\reflex\reflex\library\src\Core\Calibration\Components\DepthProcessorBase.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 52
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
ConvertDim21(...)100%210%
ConvertDim12(...)100%210%
InterpolateVector(...)100%210%

File(s)

D:\a\reflex\reflex\library\src\Core\Calibration\Components\DepthProcessorBase.cs

#LineLine coverage
 1using System;
 2using MathNet.Numerics.LinearAlgebra;
 3
 4namespace ReFlex.Core.Calibration.Components
 5{
 6    public abstract class DepthProcessorBase
 7    {
 8        #region Properties
 9
 10        public const double MaxDepthValue = 2048.0;
 11
 12        protected int Width;
 13        protected int Height;
 14
 15        #endregion
 16
 17        #region Constructor
 18
 019        protected DepthProcessorBase(int width, int height)
 020        {
 021            Width = width;
 022            Height = height;
 023        }
 24
 25        #endregion
 26
 27        #region Methods
 28
 29        protected int ConvertDim21(int x, int y) =>
 030            x + (Width * y);
 31
 32        protected double[] ConvertDim12(int i) =>
 033            new[] { i % Width, Math.Floor((i / (double)Width)) };
 34
 35        protected Vector<double> InterpolateVector(Vector<double> src, Vector<double> target, double weight)
 036        {
 037            var result = new[]
 038            {
 039                src[0] + (target[0] - src[0]) * weight,
 040                src[1] + (target[1] - src[1]) * weight,
 041                src[2] + (target[2] - src[2]) * weight
 042            };
 43
 044            return Vector<double>.Build.DenseOfArray(result);
 045        }
 46
 47        public abstract Vector<double>[,] Process(double[] depthValues);
 48
 49        #endregion
 50    }
 51
 52}